[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6784-g262e913

Stephen Kelly steveire at gmail.com
Mon Jan 6 16:46:08 EST 2014


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  262e9134dded1ea93140c01fb6ec5ada16740693 (commit)
       via  5d3835dd98df443a0bb49d72d38ae4007424b155 (commit)
      from  047f3a37ed6f8b0a06206a1ec16b932899ba3409 (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=262e9134dded1ea93140c01fb6ec5ada16740693
commit 262e9134dded1ea93140c01fb6ec5ada16740693
Merge: 047f3a3 5d3835d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:46:07 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 6 16:46:07 2014 -0500

    Merge topic 'minor-cleanups' into next
    
    5d3835d Genex: Add a nullary form for CONFIG


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d3835dd98df443a0bb49d72d38ae4007424b155
commit 5d3835dd98df443a0bb49d72d38ae4007424b155
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 15:57:25 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 22:44:23 2014 +0100

    Genex: Add a nullary form for CONFIG
    
    This is consistent with other similar expressions such as PLATFORM_ID,
    and makes the CONFIGURATION expression obsolete.
    
    Fix an off-by-one error in
    GeneratorExpressionContent::EvaluateParameters exposed by a unit test.
    
    Remove the test for 'bad' nullary use of $<CONFIG>.
    
    Add a unit test to verify that $<CONFIG> and $<CONFIGURATION> have
    the same value.

diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 12cfaf8..ac8c3f8 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -104,6 +104,8 @@ expands to ``OLD_COMPILER`` if the
 than 4.2.0.
 
 ``$<CONFIGURATION>``
+  Configuration name. Deprecated. Use ``CONFIG`` instead.
+``$<CONFIG>``
   Configuration name
 ``$<PLATFORM_ID>``
   The CMake-id of the platform
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 259ba94..5edea86 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -676,13 +676,17 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
 {
   ConfigurationTestNode() {}
 
-  virtual int NumExpectedParameters() const { return 1; }
+  virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
                        const GeneratorExpressionContent *content,
                        cmGeneratorExpressionDAGChecker *) const
   {
+    if (parameters.empty())
+      {
+      return configurationNode.Evaluate(parameters, context, content, 0);
+      }
     cmsys::RegularExpression configValidator;
     configValidator.compile("^[A-Za-z0-9_]*$");
     if (!configValidator.find(parameters.begin()->c_str()))
@@ -1801,7 +1805,7 @@ std::string GeneratorExpressionContent::EvaluateParameters(
                       + "> expression requires at least one parameter.");
     }
   if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters
-      && parameters.size() > 2)
+      && parameters.size() > 1)
     {
     reportError(context, this->GetOriginalExpression(), "$<" + identifier
                       + "> expression requires one or zero parameters.");
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 9512efc..3b85dc3 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -13,6 +13,7 @@ add_custom_target(check-part1 ALL
     -Dtest_1=$<1:content>
     -Dtest_1_with_comma=$<1:-Wl,--no-undefined>
     -Dconfig=$<CONFIGURATION>
+    -Dshort_config=$<CONFIG>
     -Dtest_and_0=$<AND:0>
     -Dtest_and_0_0=$<AND:0,0>
     -Dtest_and_0_1=$<AND:0,1>
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
index 9bef159..3207582 100644
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ b/Tests/GeneratorExpression/check-part1.cmake
@@ -2,6 +2,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/check-common.cmake)
 
 message(STATUS "config=[${config}]")
+check(config "${short_config}")
 check(test_0 "")
 check(test_0_with_comma "")
 check(test_1 "content")
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
index 1cfbf40..964ea4d 100644
--- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
@@ -1,15 +1,6 @@
 CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
   Error evaluating generator expression:
 
-    \$<CONFIG>
-
-  \$<CONFIG> expression requires exactly one parameter.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-+
-CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
-  Error evaluating generator expression:
-
     \$<CONFIG:.>
 
   Expression syntax not recognized.
@@ -21,7 +12,7 @@ CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
 
     \$<CONFIG:Foo,Bar>
 
-  \$<CONFIG> expression requires exactly one parameter.
+  \$<CONFIG> expression requires one or zero parameters.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 +
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
index c27ea5f..5c22aaa 100644
--- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
@@ -1,5 +1,4 @@
 add_custom_target(check ALL COMMAND check
-  $<CONFIG>
   $<CONFIG:.>
   $<CONFIG:Foo,Bar>
   $<CONFIG:Foo-Bar>

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

Summary of changes:
 Help/manual/cmake-generator-expressions.7.rst      |    2 ++
 Source/cmGeneratorExpressionEvaluator.cxx          |    8 ++++++--
 Tests/GeneratorExpression/CMakeLists.txt           |    1 +
 Tests/GeneratorExpression/check-part1.cmake        |    1 +
 .../GeneratorExpression/BadCONFIG-stderr.txt       |   11 +----------
 Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake |    1 -
 6 files changed, 11 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list