diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-12-26 17:07:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-01-31 13:59:15 (GMT) |
commit | 071f8e78dda152d8759539fa390b25c7f58d3cc5 (patch) | |
tree | 0f9e71cbe2e9556d44079a4311f53ec343bf3236 /Tests/RunCMake/XcodeProject | |
parent | d525754eabef7a9f6e6696ae323a8ed965e12f2e (diff) | |
download | CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.zip CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.tar.gz CMake-071f8e78dda152d8759539fa390b25c7f58d3cc5.tar.bz2 |
Apple: Add support for static frameworks
Closes: #16432
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeBundles.cmake | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake index ad4268d..833eb85 100644 --- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake @@ -50,30 +50,56 @@ if (NOT TEST_IOS AND NOT TEST_WATCHOS AND NOT TEST_TVOS) add_dependencies(AppBundleExtTest AppBundleExt) endif() -# Framework (not supported for iOS on Xcode < 6) +# Shared Framework (not supported for iOS on Xcode < 6) if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) - add_library(Framework SHARED main.c) - set_target_properties(Framework PROPERTIES FRAMEWORK TRUE) + add_library(SharedFramework SHARED main.c) + set_target_properties(SharedFramework PROPERTIES FRAMEWORK TRUE) - add_custom_target(FrameworkTest ALL + add_custom_target(SharedFrameworkTest ALL COMMAND ${CMAKE_COMMAND} -E copy - "$<TARGET_FILE:Framework>" "$<TARGET_FILE:Framework>.old") + "$<TARGET_FILE:SharedFramework>" "$<TARGET_FILE:SharedFramework>.old") - add_dependencies(FrameworkTest Framework) + add_dependencies(SharedFrameworkTest SharedFramework) # with custom extension - add_library(FrameworkExt SHARED main.c) - set_target_properties(FrameworkExt PROPERTIES FRAMEWORK TRUE) - set_target_properties(FrameworkExt PROPERTIES BUNDLE_EXTENSION "foo") - install(TARGETS FrameworkExt FRAMEWORK DESTINATION FooExtension) + add_library(SharedFrameworkExt SHARED main.c) + set_target_properties(SharedFrameworkExt PROPERTIES FRAMEWORK TRUE) + set_target_properties(SharedFrameworkExt PROPERTIES BUNDLE_EXTENSION "foo") + install(TARGETS SharedFrameworkExt FRAMEWORK DESTINATION FooExtension) - add_custom_target(FrameworkExtTest ALL + add_custom_target(SharedFrameworkExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy - "$<TARGET_FILE:FrameworkExt>" "$<TARGET_FILE:FrameworkExt>.old") + "$<TARGET_FILE:SharedFrameworkExt>" "$<TARGET_FILE:SharedFrameworkExt>.old") - add_dependencies(FrameworkExtTest FrameworkExt) + add_dependencies(SharedFrameworkExtTest SharedFrameworkExt) +endif() + +# Static Framework (not supported for Xcode < 6) + +if(NOT XCODE_VERSION VERSION_LESS 6) + add_library(StaticFramework STATIC main.c) + set_target_properties(StaticFramework PROPERTIES FRAMEWORK TRUE) + + add_custom_target(StaticFrameworkTest ALL + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_FILE:StaticFramework>" "$<TARGET_FILE:StaticFramework>.old") + + add_dependencies(StaticFrameworkTest StaticFramework) + + # with custom extension + + add_library(StaticFrameworkExt STATIC main.c) + set_target_properties(StaticFrameworkExt PROPERTIES FRAMEWORK TRUE) + set_target_properties(StaticFrameworkExt PROPERTIES BUNDLE_EXTENSION "foo") + install(TARGETS StaticFrameworkExt FRAMEWORK DESTINATION StaticFooExtension) + + add_custom_target(StaticFrameworkExtTest ALL + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_FILE:StaticFrameworkExt>" "$<TARGET_FILE:StaticFrameworkExt>.old") + + add_dependencies(StaticFrameworkExtTest StaticFrameworkExt) endif() # Bundle |