summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-09 13:25:20 +0000
committerKitware Robot <kwrobot@kitware.com>2021-02-09 08:25:27 -0500
commit340ca27f8d36f0a09382c22130ca8d4f2c030968 (patch)
treeec04124c6c8d08a1c898d3f12c49a37f7445fd2d
parent263fd22fd83967d298cda61cedf9f34ad3bf1862 (diff)
parenteafe740eadb5e9a8dfb2dddc95e063779183f2ab (diff)
downloadcmake-340ca27f8d36f0a09382c22130ca8d4f2c030968.tar.gz
Merge topic 'FindXCTest-bundle-inject' into release-3.19
eafe740ead FindXCTest: Fix output directory for test bundle with new build system Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5786
-rw-r--r--Modules/FindXCTest.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index 1f6e825138..48371e620b 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}