From 9be64f34c299edfa69b126d419b4bd0619741656 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 1 Nov 2012 14:21:25 +0100 Subject: GenEx: Use case insensitive comparison for $ This fixes a regression introduced by commit f1eacf0e (cmGeneratorExpression: Re-write for multi-stage evaluation). --- Source/cmGeneratorExpressionEvaluator.cxx | 5 ++++- Tests/CMakeLists.txt | 1 + Tests/GeneratorExpression/CMakeLists.txt | 4 ++++ Tests/GeneratorExpression/check.cmake | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index ee1b60a..2e123a4 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -16,6 +16,8 @@ #include "cmGeneratorExpressionDAGChecker.h" #include "cmGeneratorExpression.h" +#include + //---------------------------------------------------------------------------- #if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510 static @@ -253,7 +255,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode return parameters.front().empty() ? "1" : "0"; } - return *parameters.begin() == context->Config ? "1" : "0"; + return cmsysString_strcasecmp(parameters.begin()->c_str(), + context->Config) == 0 ? "1" : "0"; } } configurationTestNode; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b404333..bbf804b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -556,6 +556,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator ${CMAKE_TEST_GENERATOR} --build-project GeneratorExpression --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression") diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 891fa11..bb31476 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -16,6 +16,10 @@ add_custom_target(check ALL -Dtest_and_1_1=$ -Dtest_config_0=$x> -Dtest_config_1=$> + -Dtest_config_debug=$$$ + -Dtest_config_release=$$$ + -Dtest_config_relwithdebinfo=$$$ + -Dtest_config_minsizerel=$$$ -Dtest_not_0=$ -Dtest_not_1=$ -Dtest_or_0=$ diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake index 8ffa481..8745d57 100644 --- a/Tests/GeneratorExpression/check.cmake +++ b/Tests/GeneratorExpression/check.cmake @@ -17,6 +17,11 @@ check(test_and_1_0 "0") check(test_and_1_1 "1") check(test_config_0 "0") check(test_config_1 "1") +foreach(c debug release relwithdebinfo minsizerel) + if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$") + message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1") + endif() +endforeach() check(test_not_0 "1") check(test_not_1 "0") check(test_or_0 "0") -- cgit v0.12