Files
CMake/Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake
Yauheni Khnykin 0b5301a778 FindXCTest: Fix output directory for test bundle with Xcode 12.5
The fix from commit eafe740ead (FindXCTest: Fix output directory for
test bundle with new build system, 2021-02-09, v3.19.5~5^2) is not
necessary with Xcode 12.5, which seems to have changed/fixed the
behaviour again.

Fixes: #22462
2021-07-26 13:31:10 -04:00

23 lines
751 B
CMake

enable_language(Swift)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
find_package(XCTest REQUIRED)
add_executable(TestedApp MACOSX_BUNDLE dummy_main.swift)
xctest_add_bundle(TestingAppBundle TestedApp dummy_main.swift)
get_target_property(_lib_output_dir TestingAppBundle LIBRARY_OUTPUT_DIRECTORY)
if (NOT DEFINED TEST_EXPECTED_OUTPUT_DIR)
message(FATAL_ERROR "Testing variable TEST_EXPECTED_OUTPUT_DIR is not set")
endif()
if (NOT _lib_output_dir STREQUAL TEST_EXPECTED_OUTPUT_DIR)
message(SEND_ERROR "Property LIBRARY_OUTPUT_DIRECTORY is expected to be ${TEST_EXPECTED_OUTPUT_DIR} "
"but was ${_lib_output_dir}")
endif()