mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
string: Add MAKE_C_IDENTIFIER subcommand
This commit is contained in:
@@ -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());
|
||||
@@ -754,6 +758,24 @@ bool cmStringCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user