I'm using CMake on a HPC system that uses modules. Those modules usually set LIBRARY_PATH
and CPATH
so one can simply include headers and link against libraries without additional -L
or -I
.
However when using CMake those libraries must be found by CMake. I would expect, that LIBRARY_PATH
and CPATH
were automatically considered by CMake and captured in e.g. CMAKE_SYSTEM_LIBRARY_PATH
and CMAKE_SYSTEM_INCLUDE_PATH
but they are not.
Is there any reasoning why this was (not) done?
Wouldn't it be a good idea (for now manually, later automatically by CMake) to append LIBRARY_PATH
to CMAKE_SYSTEM_LIBRARY_PATH
and CPATH
to CMAKE_SYSTEM_INCLUDE_PATH
?