From d88bf4f7380c602c85993ffd0eae67af8b1c114d Mon Sep 17 00:00:00 2001 From: bruneton Date: Wed, 19 Jun 2013 07:00:57 +0000 Subject: [PATCH] BUG: CMake: master find macro was improperly using CMAKE_PREFIX_PATH (appending instead of overriding) --- salome_adm/cmake_files/SalomeMacros.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() -- 2.39.2