From: bruneton Date: Wed, 19 Jun 2013 06:59:50 +0000 (+0000) Subject: BUG: CMake: master find macro was improperly using CMAKE_PREFIX_PATH X-Git-Tag: B4KillOfAutomake~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5f6599f002910c7b26fd6a4f6b28cd1bcf1ce8c6;p=modules%2Fkernel.git BUG: CMake: master find macro was improperly using CMAKE_PREFIX_PATH (was appending instead of overriding) --- diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index ea4337aec..88076852d 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -231,6 +231,7 @@ MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode) ENDIF() # Call the root FIND_PACKAGE(): + #MESSAGE("blo / ${CMAKE_PREFIX_PATH} / ${CMAKE_FIND_ROOT_PATH}") IF(_tmp_compo) FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} ${mode} ${_tmp_quiet} ${_tmp_req} COMPONENTS ${_tmp_compo}) ELSE() @@ -295,8 +296,10 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) "${_CONF_DIR}/${_pkg_lc}") MARK_AS_ADVANCED(${pkg}_DIR) - IF (NOT (${pkg_UC}_FOUND OR ${pkg}_FOUND)) - LIST(APPEND CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}") + IF (NOT (${pkg_UC}_FOUND OR ${pkg}_FOUND)) + # Override the variable - don't append to it, as it would give precedence + # to what was stored there before! + SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}") ELSE() MESSAGE(STATUS "Found ${pkg} in CONFIG mode!") ENDIF()