diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2015-10-08 00:09:34 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2015-12-10 21:36:12 (GMT) |
commit | 565d080a9a1e133bda868e905226181b60e90356 (patch) | |
tree | 053f5bc1c985e5431d19a8cee5c4a5c71b071c5b /Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake | |
parent | 34f5ef564aa94f2f66f35c708dbfca260b419e4b (diff) | |
download | CMake-565d080a9a1e133bda868e905226181b60e90356.zip CMake-565d080a9a1e133bda868e905226181b60e90356.tar.gz CMake-565d080a9a1e133bda868e905226181b60e90356.tar.bz2 |
Xcode: Add support for combined install on iOS
This patch solves the problem of installing both: Device and Simulator
libraries on iOS. Before only one of them was installed.
If the IOS_INSTALL_COMBINED property is set on a target, a
special install hook will be activated which builds the corresponding
target and combines both at the install location.
The original patch was contributed by Ruslan Baratov, and polished by
Gregor Jasny.
Diffstat (limited to 'Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake')
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake new file mode 100644 index 0000000..b47d3a5 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.3) + +project(XcodeIOSInstallCombinedPrune CXX) + +set(CMAKE_OSX_SYSROOT iphoneos) +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") +set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf") + +add_library(foo SHARED foo.cpp) +install(TARGETS foo DESTINATION lib) + +add_library(baz SHARED foo.cpp) +set_target_properties( + foo baz + PROPERTIES + XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] armv7 + XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] armv7 + XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] x86_64 + XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] x86_64 +) + +add_library(boo SHARED foo.cpp) +set_target_properties( + boo + PROPERTIES + XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] arm64 + XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] arm64 + XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] i386 + XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] i386 +) + +add_custom_command( + TARGET foo + POST_BUILD + COMMAND lipo -create $<TARGET_FILE:baz> $<TARGET_FILE:boo> -output $<TARGET_FILE:foo> +) |