diff options
author | Yauheni Khnykin <yauheni.khnykin@here.com> | 2021-02-08 23:15:08 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-02-08 23:20:57 (GMT) |
commit | eafe740eadb5e9a8dfb2dddc95e063779183f2ab (patch) | |
tree | 5b6b45af720eea32d9e130db0d4346853ccead8a | |
parent | 58167b3eb07408bd04f3b00fd1b3530817c3b7d8 (diff) | |
download | CMake-eafe740eadb5e9a8dfb2dddc95e063779183f2ab.zip CMake-eafe740eadb5e9a8dfb2dddc95e063779183f2ab.tar.gz CMake-eafe740eadb5e9a8dfb2dddc95e063779183f2ab.tar.bz2 |
FindXCTest: Fix output directory for test bundle with new build system
The output directory was still correct for macOS with the new build system,
but not for iOS.
Fixes: #20662
-rw-r--r-- | Modules/FindXCTest.cmake | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake index 1f6e825..48371e6 100644 --- a/Modules/FindXCTest.cmake +++ b/Modules/FindXCTest.cmake @@ -155,9 +155,16 @@ function(xctest_add_bundle target testee) set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_BUNDLE_LOADER "$(TEST_HOST)" XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:${testee}>") - if(NOT XCODE_VERSION VERSION_LESS 7.3) + if(XCODE_VERSION VERSION_GREATER_EQUAL 7.3) + # CMAKE_XCODE_BUILD_SYSTEM equals 12 means that at least Xcode 11.x is used. + if(CMAKE_XCODE_BUILD_SYSTEM EQUAL 12 AND + NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(_output_directory "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>") + else() + set(_output_directory "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>/PlugIns") + endif() set_target_properties(${target} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>/PlugIns") + LIBRARY_OUTPUT_DIRECTORY "${_output_directory}") endif() else(XCODE) target_link_libraries(${target} |