From 297c63fa65327491a2b50e521b661c5835a19fe4 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 13 Aug 2013 07:48:01 -0400 Subject: Imported Upstream version 2.8.11.2 --- Modules/Platform/Darwin.cmake | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'Modules/Platform/Darwin.cmake') diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 4e7e99ca3..2e6b71e36 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -256,6 +256,24 @@ set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK if(NOT DEFINED CMAKE_FIND_FRAMEWORK) set(CMAKE_FIND_FRAMEWORK FIRST) endif() + +# Older OS X linkers do not report their framework search path +# with -v but "man ld" documents the following locations. +set(CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + ${_CMAKE_OSX_SYSROOT_PATH}/Library/Frameworks + ${_CMAKE_OSX_SYSROOT_PATH}/System/Library/Frameworks + ) +if(_CMAKE_OSX_SYSROOT_PATH) + # Treat some paths as implicit so we do not override the SDK versions. + list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + /System/Library/Frameworks) +endif() +if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5") + # Older OS X tools had more implicit paths. + list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + ${_CMAKE_OSX_SYSROOT_PATH}/Network/Library/Frameworks) +endif() + # set up the default search directories for frameworks set(CMAKE_SYSTEM_FRAMEWORK_PATH ~/Library/Frameworks @@ -263,6 +281,23 @@ set(CMAKE_SYSTEM_FRAMEWORK_PATH /Network/Library/Frameworks /System/Library/Frameworks) +# Warn about known system mis-configuration case. +if(CMAKE_OSX_SYSROOT) + get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE) + if(NOT _IN_TC AND + NOT IS_SYMLINK "${CMAKE_OSX_SYSROOT}/Library/Frameworks" + AND IS_SYMLINK "${CMAKE_OSX_SYSROOT}/Library/Frameworks/Frameworks") + message(WARNING "The SDK Library/Frameworks path\n" + " ${CMAKE_OSX_SYSROOT}/Library/Frameworks\n" + "is not set up correctly on this system. " + "This is known to occur when installing Xcode 3.2.6:\n" + " http://bugs.python.org/issue14018\n" + "The problem may cause build errors that report missing system frameworks. " + "Fix your SDK symlinks to resolve this issue and avoid this warning." + ) + endif() +endif() + # default to searching for application bundles first if(NOT DEFINED CMAKE_FIND_APPBUNDLE) set(CMAKE_FIND_APPBUNDLE FIRST) -- cgit v1.2.3