diff options
author | Brad King <brad.king@kitware.com> | 2013-05-22 17:05:29 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-22 17:05:29 (GMT) |
commit | 2da5b51b0c92b99a9b335f2d05dcdc115b8920ac (patch) | |
tree | 8afec337a2bbc25111f73a589e76091cf7b616cc /Source/cmStringCommand.cxx | |
parent | fe4c1fb32e877ea36c6882cefe4e773157573903 (diff) | |
parent | 0ab50aea4c4d7099b339fb38b4459d0debbdbd85 (diff) | |
download | CMake-2da5b51b0c92b99a9b335f2d05dcdc115b8920ac.zip CMake-2da5b51b0c92b99a9b335f2d05dcdc115b8920ac.tar.gz CMake-2da5b51b0c92b99a9b335f2d05dcdc115b8920ac.tar.bz2 |
Merge topic 'string-MAKE_C_IDENTIFIER-subcommand'
0ab50ae string: Add MAKE_C_IDENTIFIER subcommand
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r-- | Source/cmStringCommand.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index e49edd8..1fbde01 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -93,6 +93,10 @@ bool cmStringCommand { return this->HandleTimestampCommand(args); } + else if(subCommand == "MAKE_C_IDENTIFIER") + { + return this->HandleMakeCIdentifierCommand(args); + } std::string e = "does not recognize sub-command "+subCommand; this->SetError(e.c_str()); @@ -755,6 +759,24 @@ bool cmStringCommand } //---------------------------------------------------------------------------- +bool cmStringCommand +::HandleMakeCIdentifierCommand(std::vector<std::string> const& args) +{ + if(args.size() != 3) + { + this->SetError("sub-command MAKE_C_IDENTIFIER requires two arguments."); + return false; + } + + const std::string& input = args[1]; + const std::string& variableName = args[2]; + + this->Makefile->AddDefinition(variableName.c_str(), + cmSystemTools::MakeCidentifier(input.c_str()).c_str()); + return true; +} + +//---------------------------------------------------------------------------- bool cmStringCommand::HandleStripCommand( std::vector<std::string> const& args) { |