Ticket #32302: patch-CMake_Utils_FindPkgMacros.cmake.diff

File patch-CMake_Utils_FindPkgMacros.cmake.diff, 1.7 KB (added by marin.saric@…, 13 years ago)
  • CMake/Utils/FindPkgMacros.cmake

    old new  
    126126# Slightly customised framework finder
    127127MACRO(findpkg_framework fwk)
    128128  IF(APPLE)
    129     SET(${fwk}_FRAMEWORK_PATH
     129    SET(${fwk}_FRAMEWORK_PATH "")   # The pessimistic assumption
     130    SET(${fwk}_FRAMEWORK_TEMP_SEARCH_PATH
    130131      ${${fwk}_FRAMEWORK_SEARCH_PATH}
    131132      ${CMAKE_FRAMEWORK_PATH}
    132133      ~/Library/Frameworks
     
    138139      ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
    139140    )
    140141    # These could be arrays of paths, add each individually to the search paths
    141     foreach(i ${OGRE_PREFIX_PATH})
    142       set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
     142    foreach(i ${OGRE_PREFIX_PATH} ${OGRE_PREFIX_BUILD})
     143      LIST(APPEND ${fwk}_FRAMEWORK_TEMP_SEARCH_PATH
     144        ${i}/lib/Release ${i}/lib/Debug)
    143145    endforeach(i)
    144146
    145     foreach(i ${OGRE_PREFIX_BUILD})
    146       set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
    147     endforeach(i)
    148 
    149     FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
     147    FOREACH(dir ${${fwk}_FRAMEWORK_TEMP_SEARCH_PATH})
    150148      SET(fwkpath ${dir}/${fwk}.framework)
    151149      IF(EXISTS ${fwkpath})
    152         SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
    153           ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
    154         SET(${fwk}_FRAMEWORK_PATH ${dir})
     150        IF (NOT ${fwk}_FRAMEWORK_PATH)
     151          SET(${fwk}_FRAMEWORK_PATH ${dir})
     152          SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
     153            ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
     154        ENDIF()
    155155        if (NOT ${fwk}_LIBRARY_FWK)
    156156          SET(${fwk}_LIBRARY_FWK "-framework ${fwk}")
    157157        endif ()