diff options
author | Brad King <brad.king@kitware.com> | 2019-10-02 12:15:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-02 12:17:32 (GMT) |
commit | ac9934406da6793a8c841db6d53f292f65124ed7 (patch) | |
tree | b3f77209eb61e2e1dfc80e3b13e7d000113e451d /Tests | |
parent | 6fb747a01c27a2226fe4cbf77bc19e6d21286f81 (diff) | |
download | CMake-ac9934406da6793a8c841db6d53f292f65124ed7.zip CMake-ac9934406da6793a8c841db6d53f292f65124ed7.tar.gz CMake-ac9934406da6793a8c841db6d53f292f65124ed7.tar.bz2 |
Xcode: Restore CMAKE_XCODE_GENERATE_SCHEME for custom targets
The target property introduced by commit 413b71485a (Xcode: Create Xcode
schemes per target, 2019-03-11, v3.15.0-rc1~347^2) was accidentally not
initialized by `CMAKE_XCODE_GENERATE_SCHEME` for custom targets. Fix it
and update the test.
Fixes: #19759
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake index 88077b3..7d83a70 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake @@ -7,6 +7,13 @@ function(check_property property matcher) endif() endfunction() +function(expect_schema target) + set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme") + if(NOT EXISTS ${schema}) + message(SEND_ERROR "Missing schema for target ${target}") + endif() +endfunction() + function(expect_no_schema target) set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme") if(EXISTS ${schema}) @@ -40,3 +47,6 @@ check_property("ENVIRONMENT" [=[key="BAR"]=]) check_property("ENVIRONMENT" [=[value="bar"]=]) expect_no_schema("NoSchema") + +expect_schema("CustomTarget") +expect_schema("ALL_BUILD") diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake index 73ef5ca..be219f4 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake @@ -38,3 +38,5 @@ create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar") add_executable(NoSchema main.cpp) set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF) + +add_custom_target(CustomTarget) |