diff options
author | Brad King <brad.king@kitware.com> | 2017-01-24 19:45:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-01-24 19:45:24 (GMT) |
commit | 6122fc54a9275caf3054a12bbc813be2c8036863 (patch) | |
tree | 93b09abb98fc0cf2d30a6ea5183b7d925c17c15d /Tests | |
parent | 6c99ec5bfdc9710355e3318cb9884638ea2ce925 (diff) | |
parent | 10c9c73d58b481a212d1ed87ceeb227a7654bc56 (diff) | |
download | CMake-6122fc54a9275caf3054a12bbc813be2c8036863.zip CMake-6122fc54a9275caf3054a12bbc813be2c8036863.tar.gz CMake-6122fc54a9275caf3054a12bbc813be2c8036863.tar.bz2 |
Merge topic '16253-xcode-effective-platform-name'
10c9c73d Xcode: Control emission of EFFECTIVE_PLATFORM_NAME
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 21 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeMultiplatform.cmake | 14 |
2 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 60912c2..f51a107 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -166,3 +166,24 @@ if(NOT XCODE_VERSION VERSION_LESS 6) unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_OPTIONS) endif() + +if(NOT XCODE_VERSION VERSION_LESS 5) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeMultiplatform-build) + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeMultiplatform) + + # build ios before macos + run_cmake_command(XcodeMultiplatform-iphonesimulator-build ${CMAKE_COMMAND} --build . -- -sdk iphonesimulator) + run_cmake_command(XcodeMultiplatform-iphonesimulator-install ${CMAKE_COMMAND} --build . --target install -- -sdk iphonesimulator DESTDIR=${RunCMake_TEST_BINARY_DIR}/_install_iphonesimulator) + + run_cmake_command(XcodeMultiplatform-macosx-build ${CMAKE_COMMAND} --build . -- -sdk macosx) + run_cmake_command(XcodeMultiplatform-macosx-install ${CMAKE_COMMAND} --build . --target install -- -sdk macosx DESTDIR=${RunCMake_TEST_BINARY_DIR}/_install_macosx) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeMultiplatform.cmake b/Tests/RunCMake/XcodeProject/XcodeMultiplatform.cmake new file mode 100644 index 0000000..a1064f4 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeMultiplatform.cmake @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.3) +enable_language(CXX) + +set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME ON) + +set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx iphonesimulator") +set(CMAKE_MACOSX_BUNDLE true) + +add_library(library STATIC foo.cpp) + +add_executable(main main.cpp) +target_link_libraries(main library) + +install(TARGETS library ARCHIVE DESTINATION lib) |