

The order of priority is explicitly set in SALOME to:ĬONFIG (also called NO_MODULE) mode: this tries to load a xyz-config.cmake file from the package installation itself. The order of priority for the detection of a package is (from high to low priority):ĬMake variables explicitly set by the user (typically on the command line with -DXYZ_ROOT_DIR=…)Įnvironment variables set by the user (with the same name XYZ_ROOT_DIR)ĭefault value based on a previous dependency using the tool alreadyĭetection direclty in the host system by the standard CMake logicĬMake has two possible modes of detection, CONFIG mode and MODULE mode.

Typically under Linux, one would never set PTHREAD_ROOT_DIR, thus leaving the logic find the system installation.īeware that package names in the CMakeLists.txt are case-sensitive, but the corresponding variables are always upper-case (because on some platforms environment variables are not case-sensitive). The variables *_ROOT_DIR are only there to guide the process, not to force it. For example, theĭetection of Qt4 is guided by setting QT4_ROOT_DIR. Where is ( exactly) the upper case name of the standard CMake module. This is done exclusively through the variables exposed in the KERNEL configuration file: KERNEL_INCLUDE_DIRS, KERNEL_DEFINITIONS. However if KERNEL was compiled with MPI, then some of the information (include directories, definitions, …) needs to be propagated to GUI (in this case for example, MPI needs to be in the list of include directories, since GUI include KERNEL headers, which themselves include MPI headers). Hence GUI does not detect the MPI package.
#CMAKE SET VARIABLES CODE#
This is not strictly always possible, but should enforce as often as possible.įinally only the direct dependencies of a module should be explicitly detected: for example GUI has no source code which uses MPI functionalities. This means the user compiling SALOME should not have to set anything else than those XYZ variables (no PATH override, no LD_LIBRARY_PATH override should be necessary). On the XYZ_ROOT_DIR variable giving the installation path of the package. Second, the implementation of the detection process relies exclusively It is assumed those modules will get better and better with newer releases of CMakeĪnd using them ensures future compatibility with newer versions of CMake. Much as possible on the standard CMake detection modules (FindXyz.cmake files, located in the standard CMake installation directory). The philosophy of the SALOME package detection is, first, to rely as
