Salome HOME
CMake: in CONFIG mode, adding NO_CMAKE_SYSTEM_PATH option to avoid looking into
authorbruneton <bruneton>
Fri, 19 Jul 2013 12:55:20 +0000 (12:55 +0000)
committerbruneton <bruneton>
Fri, 19 Jul 2013 12:55:20 +0000 (12:55 +0000)
system directories. See documentation of macro SALOME_FIND_PACKAGE().

salome_adm/cmake_files/SalomeMacros.cmake

index 6c0a84ebfa2b879fd944119059b7a0aee6768ad8..73567594a1dc25d07d6e10c5809a38d4bdf4eca8 100755 (executable)
@@ -210,6 +210,9 @@ ENDMACRO()
 #
 # Modus is either MODULE or CONFIG (cf standard FIND_PACKAGE() documentation).
 # The last argument is optional and if set to TRUE will force the search to be OPTIONAL and QUIET.
+# If the package is looked for in CONFIG mode, the standard system paths are skipped. If you still want a 
+# system installation to be found in this mode, you have to set the ROOT_DIR variable explicitly to /usr (for
+# example). 
 #  
 # This macro is to be called from within the FindSalomeXXXX.cmake file.
 #
@@ -251,12 +254,12 @@ MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode)
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} 
               NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}
               PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
-              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY)
+              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH)
       ELSE()
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} 
               NO_MODULE ${_tmp_quiet} ${_tmp_req}
               PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
-              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY)
+              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH)
       ENDIF()
       MARK_AS_ADVANCED(${stdPkg}_DIR)