diff options
author | Brad King <brad.king@kitware.com> | 2019-02-05 12:30:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-05 12:33:04 (GMT) |
commit | c03072f2f7a08c6ddf0cec58dfc8ea2b83f4c1a9 (patch) | |
tree | afb2c6960e306ed36217f0cc6a1f7cad15d9ed3d /Modules/Platform | |
parent | 25e616862dac08aae7c4a3ad01839acfe7342ec7 (diff) | |
parent | e8ee8cab97bdb084d4555ee3e76eb33303e3bc85 (diff) | |
download | CMake-c03072f2f7a08c6ddf0cec58dfc8ea2b83f4c1a9.zip CMake-c03072f2f7a08c6ddf0cec58dfc8ea2b83f4c1a9.tar.gz CMake-c03072f2f7a08c6ddf0cec58dfc8ea2b83f4c1a9.tar.bz2 |
Merge topic '17870-iphone-friendly-cmake'
e8ee8cab97 Xcode: Completely disable code signing for compiler id detection
11da882a12 Apple: Introduce separate system name for iOS, tvOS, and watchOS
36cf44a7a3 Tests: Isolate RunCMake.XcodeProject per-device cases from host arch
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2392
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Darwin-Initialize.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/iOS-Determine-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/iOS-Initialize.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/iOS.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/tvOS-Determine-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/tvOS-Initialize.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/tvOS.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/watchOS-Determine-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/watchOS-Initialize.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/watchOS.cmake | 1 |
11 files changed, 42 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 3db77aa..2d797f6 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -34,7 +34,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1" # CMAKE_OSX_DEPLOYMENT_TARGET # Set cache variable - end user may change this during ccmake or cmake-gui configure. -if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND _CURRENT_OSX_VERSION VERSION_GREATER 10.3) set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.") endif() @@ -49,6 +49,12 @@ elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND (NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}")) # Use the value of SDKROOT from the environment. set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}") +elseif(CMAKE_SYSTEM_NAME STREQUAL iOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "iphoneos") +elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "appletvos") +elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos") elseif("${CMAKE_GENERATOR}" MATCHES Xcode OR CMAKE_OSX_DEPLOYMENT_TARGET OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]" diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 727baa6..a73ffba 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -1,5 +1,13 @@ set(APPLE 1) +if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + set(CMAKE_MACOSX_BUNDLE ON) + + set(CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}") + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + # Darwin versions: # 6.x == Mac OSX 10.2 (Jaguar) # 7.x == Mac OSX 10.3 (Panther) diff --git a/Modules/Platform/iOS-Determine-CXX.cmake b/Modules/Platform/iOS-Determine-CXX.cmake new file mode 100644 index 0000000..ac80fa6 --- /dev/null +++ b/Modules/Platform/iOS-Determine-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-Determine-CXX) diff --git a/Modules/Platform/iOS-Initialize.cmake b/Modules/Platform/iOS-Initialize.cmake new file mode 100644 index 0000000..41399a3 --- /dev/null +++ b/Modules/Platform/iOS-Initialize.cmake @@ -0,0 +1,7 @@ +include(Platform/Darwin-Initialize) + +if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhone(OS|Simulator)") + message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an iOS SDK") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/iOS.cmake b/Modules/Platform/iOS.cmake new file mode 100644 index 0000000..850ddc2 --- /dev/null +++ b/Modules/Platform/iOS.cmake @@ -0,0 +1 @@ +include(Platform/Darwin) diff --git a/Modules/Platform/tvOS-Determine-CXX.cmake b/Modules/Platform/tvOS-Determine-CXX.cmake new file mode 100644 index 0000000..ac80fa6 --- /dev/null +++ b/Modules/Platform/tvOS-Determine-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-Determine-CXX) diff --git a/Modules/Platform/tvOS-Initialize.cmake b/Modules/Platform/tvOS-Initialize.cmake new file mode 100644 index 0000000..6834c80 --- /dev/null +++ b/Modules/Platform/tvOS-Initialize.cmake @@ -0,0 +1,7 @@ +include(Platform/Darwin-Initialize) + +if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTV(OS|Simulator)") + message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an tvOS SDK") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/tvOS.cmake b/Modules/Platform/tvOS.cmake new file mode 100644 index 0000000..850ddc2 --- /dev/null +++ b/Modules/Platform/tvOS.cmake @@ -0,0 +1 @@ +include(Platform/Darwin) diff --git a/Modules/Platform/watchOS-Determine-CXX.cmake b/Modules/Platform/watchOS-Determine-CXX.cmake new file mode 100644 index 0000000..ac80fa6 --- /dev/null +++ b/Modules/Platform/watchOS-Determine-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-Determine-CXX) diff --git a/Modules/Platform/watchOS-Initialize.cmake b/Modules/Platform/watchOS-Initialize.cmake new file mode 100644 index 0000000..2f396d3 --- /dev/null +++ b/Modules/Platform/watchOS-Initialize.cmake @@ -0,0 +1,7 @@ +include(Platform/Darwin-Initialize) + +if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/Watch(OS|Simulator)") + message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an watchOS SDK") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/watchOS.cmake b/Modules/Platform/watchOS.cmake new file mode 100644 index 0000000..850ddc2 --- /dev/null +++ b/Modules/Platform/watchOS.cmake @@ -0,0 +1 @@ +include(Platform/Darwin) |