summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-23 12:40:07 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-23 12:40:07 (GMT)
commite9cae187c38ffef4da0b486980491d87e1d91507 (patch)
treee4f726b2c69872666f11cb2803c5aca5a79ccf79
parentaec5bf8edb1b4fb4a13689992abfd9cba54046e8 (diff)
parent764775c4dd7b97e753d566d363c7ce9968343b5b (diff)
downloadCMake-e9cae187c38ffef4da0b486980491d87e1d91507.zip
CMake-e9cae187c38ffef4da0b486980491d87e1d91507.tar.gz
CMake-e9cae187c38ffef4da0b486980491d87e1d91507.tar.bz2
Merge topic 'fix-xcode-attribute-LOCATIONs'
764775c4 Fix XCODE_ATTRIBUTE_..._LOCATION target property lookup
-rw-r--r--Source/cmTarget.cxx3
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeLocation-check.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeLocation.cmake3
4 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1dad742..eb17561 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1164,7 +1164,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
}
}
// Support "<CONFIG>_LOCATION".
- else if (cmHasLiteralSuffix(prop, "_LOCATION")) {
+ else if (cmHasLiteralSuffix(prop, "_LOCATION") &&
+ !cmHasLiteralPrefix(prop, "XCODE_ATTRIBUTE_")) {
std::string configName(prop.c_str(), prop.size() - 9);
if (configName != "IMPORTED") {
if (!this->HandleLocationPropertyPolicy(context)) {
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)