diff options
author | Brad King <brad.king@kitware.com> | 2016-09-22 15:03:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-22 15:29:52 (GMT) |
commit | 764775c4dd7b97e753d566d363c7ce9968343b5b (patch) | |
tree | 234b5d5e55bb082351577a92d552d65dca4074aa /Tests/RunCMake/XcodeProject | |
parent | f4475eb92beade22fca16f21b40df19b48c6559b (diff) | |
download | CMake-764775c4dd7b97e753d566d363c7ce9968343b5b.zip CMake-764775c4dd7b97e753d566d363c7ce9968343b5b.tar.gz CMake-764775c4dd7b97e753d566d363c7ce9968343b5b.tar.bz2 |
Fix XCODE_ATTRIBUTE_..._LOCATION target property lookup
Refactoring in commit v3.5.0-rc1~272^2~16 (cmGeneratorTarget: Add API for
property keys, 2015-10-25) changed the Xcode generator implementation of
`XCODE_ATTRIBUTE_...` properties to use the target `GetProperty` method on each
`XCODE_ATTRIBUTE_...` property listed by `GetPropertyKeys` instead of looping
over the property entries directly. This made the lookup of property names of
the form `XCODE_ATTRIBUTE_..._LOCATION` accidentally trigger the computed
property logic for the undocumented/legacy `<CONFIG>_LOCATION` property. Of
course the computed property value is not the same as the value stored in the
`XCODE_ATTRIBUTE_..._LOCATION` property. Fix the computed property logic to
avoid triggering on `XCODE_ATTRIBUTE_...` attributes.
Closes: #16319
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeAttributeLocation-check.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeAttributeLocation.cmake | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 0684d57..d43c80d 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -1,6 +1,7 @@ include(RunCMake) run_cmake(XcodeFileType) +run_cmake(XcodeAttributeLocation) run_cmake(XcodeAttributeGenex) run_cmake(XcodeAttributeGenexError) run_cmake(XcodeObjectNeedsEscape) diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeLocation-check.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeLocation-check.cmake new file mode 100644 index 0000000..2f55131 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeAttributeLocation-check.cmake @@ -0,0 +1,7 @@ +set(expect "DEPLOYMENT_LOCATION = YES") +file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeAttributeLocation.xcodeproj/project.pbxproj actual + REGEX "DEPLOYMENT_LOCATION = .*;" LIMIT_COUNT 1) +if(NOT "${actual}" MATCHES "${expect}") + message(SEND_ERROR "The actual project contains the line:\n ${actual}\n" + "which does not match expected regex:\n ${expect}\n") +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeLocation.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeLocation.cmake new file mode 100644 index 0000000..5ab5528 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeAttributeLocation.cmake @@ -0,0 +1,3 @@ +enable_language(C) +add_executable(some main.c) +set_property(TARGET some PROPERTY XCODE_ATTRIBUTE_DEPLOYMENT_LOCATION YES) |