summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/XcodeProject/DeploymentTarget.cmake')
-rw-r--r--Tests/RunCMake/XcodeProject/DeploymentTarget.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
new file mode 100644
index 0000000..6281352
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 3.10)
+project(DeploymentTarget C)
+
+# using Xcode 7.1 SDK versions for deployment targets
+
+if(SDK MATCHES iphone)
+ set(CMAKE_OSX_SYSROOT ${SDK})
+ set(CMAKE_OSX_ARCHITECTURES "armv7;x86_64")
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "9.1")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
+elseif(SDK MATCHES watch)
+ set(CMAKE_OSX_SYSROOT ${SDK})
+ set(CMAKE_OSX_ARCHITECTURES "armv7k;i386")
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
+elseif(SDK MATCHES appletv)
+ set(CMAKE_OSX_SYSROOT ${SDK})
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
+ set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
+else()
+ set(CMAKE_OSX_SYSROOT ${SDK})
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
+endif()
+
+add_library(myFramework STATIC DeploymentTarget.c)
+set_target_properties(myFramework PROPERTIES FRAMEWORK TRUE)