I write a generic function to support the search of the dependencies.
If I write the following command:
find_package(HDF5 REQUIRED HINTS /opt/cots/)
the cmake (version 3.13.4 on REHL7 ) is able to find correctly the dependencies and everything is working properly. if instead I try to write generic code like that:
set(HDF5_HINT_ROOT "/opt/cots/") # in another file
set(HDF5_HINT_STRING "HINTS ${HDF5_HINT_ROOT}")
find_package(HDF5 REQUIRED ${HDF5_HINT_STRING})
I obtain the following error:
CMake Error at /usr/share/cmake3/Modules/FindHDF5.cmake:136 (message):
HINTS /opt/cots/ is not a valid HDF5 component.
Expansion of the variable with --trace-expand is exactly the same. What I 'm missing?
Thanks in advance