Genex: Accept arbitrary content in *_CASE and MAKE_C_IDENTIFIER.

This commit is contained in:
Stephen Kelly 2013-12-15 11:02:56 +01:00
parent d36b489401
commit f4d9466130
3 changed files with 12 additions and 6 deletions

View File

@ -201,6 +201,8 @@ static const struct LowerCaseNode : public cmGeneratorExpressionNode
{ {
LowerCaseNode() {} LowerCaseNode() {}
bool AcceptsArbitraryContentParameter() const { return true; }
std::string Evaluate(const std::vector<std::string> &parameters, std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *, cmGeneratorExpressionContext *,
const GeneratorExpressionContent *, const GeneratorExpressionContent *,
@ -215,6 +217,8 @@ static const struct UpperCaseNode : public cmGeneratorExpressionNode
{ {
UpperCaseNode() {} UpperCaseNode() {}
bool AcceptsArbitraryContentParameter() const { return true; }
std::string Evaluate(const std::vector<std::string> &parameters, std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *, cmGeneratorExpressionContext *,
const GeneratorExpressionContent *, const GeneratorExpressionContent *,
@ -229,6 +233,8 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
{ {
MakeCIdentifierNode() {} MakeCIdentifierNode() {}
bool AcceptsArbitraryContentParameter() const { return true; }
std::string Evaluate(const std::vector<std::string> &parameters, std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *, cmGeneratorExpressionContext *,
const GeneratorExpressionContent *, const GeneratorExpressionContent *,

View File

@ -193,9 +193,9 @@ add_custom_target(check-part3 ALL
-Dtest_platform_id_Linux=$<PLATFORM_ID:Linux> -Dtest_platform_id_Linux=$<PLATFORM_ID:Linux>
-Dtest_platform_id_Windows=$<PLATFORM_ID:Windows> -Dtest_platform_id_Windows=$<PLATFORM_ID:Windows>
-Dtest_platform_id_Darwin=$<PLATFORM_ID:Darwin> -Dtest_platform_id_Darwin=$<PLATFORM_ID:Darwin>
-Dlower_case=$<LOWER_CASE:MiXeD> -Dlower_case=$<LOWER_CASE:Mi,XeD>
-Dupper_case=$<UPPER_CASE:MiXeD> -Dupper_case=$<UPPER_CASE:MiX,eD>
-Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4foo:+bar-$> -Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4f,oo:+bar-$>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM VERBATIM

View File

@ -34,6 +34,6 @@ foreach(system Linux Windows Darwin)
check(test_platform_id_${system} 0) check(test_platform_id_${system} 0)
endif() endif()
endforeach() endforeach()
check(lower_case "mixed") check(lower_case "mi,xed")
check(upper_case "MIXED") check(upper_case "MIX,ED")
check(make_c_identifier "_4foo__bar__") check(make_c_identifier "_4f_oo__bar__")