[Cmake-commits] CMake branch, next, updated. v3.1.3-1331-g2aa7f9a

Brad King brad.king at kitware.com
Thu Feb 12 13:36:26 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  2aa7f9aec3ab5608b8a5f38c6d07bf647bc2c084 (commit)
       via  bf8f9c29e745933d5732f4481669c38ba8bdc3fc (commit)
      from  0c249a20a57a744b88c44537df6206cd83ae2440 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2aa7f9aec3ab5608b8a5f38c6d07bf647bc2c084
commit 2aa7f9aec3ab5608b8a5f38c6d07bf647bc2c084
Merge: 0c249a2 bf8f9c2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 12 13:36:12 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 12 13:36:12 2015 -0500

    Merge topic 'xcode-attribute-genex' into next
    
    bf8f9c29 Xcode: Teach XCODE_ATTRIBUTE target properties about generator expressions


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf8f9c29e745933d5732f4481669c38ba8bdc3fc
commit bf8f9c29e745933d5732f4481669c38ba8bdc3fc
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Wed Feb 11 20:48:43 2015 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 12 13:35:31 2015 -0500

    Xcode: Teach XCODE_ATTRIBUTE target properties about generator expressions
    
    Signed-off-by: Gregor Jasny <gjasny at googlemail.com>

diff --git a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
index de98c37..7e00ac4 100644
--- a/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
+++ b/Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst
@@ -8,3 +8,9 @@ the generated Xcode project.  Ignored on other generators.
 
 See the :variable:`CMAKE_XCODE_ATTRIBUTE_<an-attribute>` variable
 to set attributes on all targets in a directory tree.
+
+Contents of ``XCODE_ATTRIBUTE_<an-attribute>`` may use
+"generator expressions" with the syntax ``$<...>``.  See the
+:manual:`cmake-generator-expressions(7)` manual for available
+expressions.  See the :manual:`cmake-buildsystem(7)` manual
+for more on defining buildsystem properties.
diff --git a/Help/release/dev/xcode-attribute-genex.rst b/Help/release/dev/xcode-attribute-genex.rst
new file mode 100644
index 0000000..3fd5b1c
--- /dev/null
+++ b/Help/release/dev/xcode-attribute-genex.rst
@@ -0,0 +1,5 @@
+xcode-attribute-genex
+---------------------
+
+* The :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property learned
+  to support generator expressions.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 30ed134..aea134e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2436,8 +2436,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
       if (!attribute.empty())
         {
+        cmGeneratorExpression ge;
+        std::string processed = ge.Parse(i->second.GetValue())
+          ->Evaluate(this->CurrentMakefile, configName);
         buildSettings->AddAttribute(attribute.c_str(),
-                                    this->CreateString(i->second.GetValue()));
+                                    this->CreateString(processed));
         }
       }
     }
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 8e4026b..792f40e 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
 include(RunCMake)
 
 run_cmake(XcodeFileType)
+run_cmake(XcodeAttributeGenex)
+run_cmake(XcodeAttributeGenexError)
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake
new file mode 100644
index 0000000..637df0f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake
@@ -0,0 +1,7 @@
+set(expect "TEST_HOST = \"[^;\"]*Tests/RunCMake/XcodeProject/XcodeAttributeGenex-build/[^;\"/]*/some\"")
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeAttributeGenex.xcodeproj/project.pbxproj actual
+     REGEX "TEST_HOST = .*;" 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/XcodeAttributeGenex.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake
new file mode 100644
index 0000000..760b882
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+add_executable(some main.c)
+add_executable(another main.c)
+set_property(TARGET another PROPERTY XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:some>")
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<NOTAGENEX>
+
+  Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake
new file mode 100644
index 0000000..98ad6c5
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+add_executable(some main.c)
+add_executable(another main.c)
+set_property(TARGET another PROPERTY XCODE_ATTRIBUTE_TEST_HOST "$<NOTAGENEX>")

-----------------------------------------------------------------------

Summary of changes:
 Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst                  |    6 ++++++
 Help/release/dev/xcode-attribute-genex.rst                      |    5 +++++
 Source/cmGlobalXCodeGenerator.cxx                               |    5 ++++-
 Tests/RunCMake/XcodeProject/RunCMakeTest.cmake                  |    2 ++
 Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake     |    7 +++++++
 Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake           |    4 ++++
 .../XcodeAttributeGenexError-result.txt}                        |    0
 .../XcodeAttributeGenexError-stderr.txt}                        |    0
 Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake      |    4 ++++
 9 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 Help/release/dev/xcode-attribute-genex.rst
 create mode 100644 Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake
 create mode 100644 Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => XcodeProject/XcodeAttributeGenexError-result.txt} (100%)
 copy Tests/RunCMake/{install/TARGETS-DESTINATION-bad-stderr.txt => XcodeProject/XcodeAttributeGenexError-stderr.txt} (100%)
 create mode 100644 Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list