Add another missing CMake macro
This commit is contained in:
parent
ddc2d795f5
commit
a093ebd018
1 changed files with 36 additions and 0 deletions
|
@ -19,6 +19,42 @@
|
|||
# Win32, Apple, and Android are not tested!
|
||||
# Linux tested and works
|
||||
|
||||
# Slightly customised framework finder
|
||||
macro(findpkg_framework fwk)
|
||||
if(APPLE)
|
||||
set(${fwk}_FRAMEWORK_PATH
|
||||
${${fwk}_FRAMEWORK_SEARCH_PATH}
|
||||
${CMAKE_FRAMEWORK_PATH}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/System/Library/Frameworks
|
||||
/Network/Library/Frameworks
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Release
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx/Debug
|
||||
)
|
||||
# These could be arrays of paths, add each individually to the search paths
|
||||
foreach(i ${OGRE_PREFIX_PATH})
|
||||
set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/macosx/Release ${i}/lib/macosx/Debug)
|
||||
endforeach(i)
|
||||
|
||||
foreach(i ${OGRE_PREFIX_BUILD})
|
||||
set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/macosx/Release ${i}/lib/macosx/Debug)
|
||||
endforeach(i)
|
||||
|
||||
foreach(dir ${${fwk}_FRAMEWORK_PATH})
|
||||
set(fwkpath ${dir}/${fwk}.framework)
|
||||
if(EXISTS ${fwkpath})
|
||||
set(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
|
||||
${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
|
||||
set(${fwk}_FRAMEWORK_PATH ${dir})
|
||||
if (NOT ${fwk}_LIBRARY_FWK)
|
||||
set(${fwk}_LIBRARY_FWK "-framework ${fwk}")
|
||||
endif ()
|
||||
endif(EXISTS ${fwkpath})
|
||||
endforeach(dir)
|
||||
endif(APPLE)
|
||||
endmacro(findpkg_framework)
|
||||
|
||||
macro(create_search_paths PREFIX)
|
||||
foreach(dir ${${PREFIX}_PREFIX_PATH})
|
||||
set(${PREFIX}_INC_SEARCH_PATH ${${PREFIX}_INC_SEARCH_PATH}
|
||||
|
|
Loading…
Add table
Reference in a new issue