added escape quotes option
This commit is contained in:
parent
43793f7df4
commit
8609fdb051
|
@ -51,12 +51,28 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string>& args)
|
|||
m_InputFile = args[0];
|
||||
m_OuputFile = args[1];
|
||||
m_CopyOnly = false;
|
||||
m_EscapeQuotes = false;
|
||||
if(args.size() >= 3)
|
||||
{
|
||||
if(args[2] == "COPYONLY")
|
||||
{
|
||||
m_CopyOnly = true;
|
||||
}
|
||||
if(args[2] == "ESCAPE_QUOTES")
|
||||
{
|
||||
m_EscapeQuotes = true;
|
||||
}
|
||||
}
|
||||
if(args.size() >= 4)
|
||||
{
|
||||
if(args[3] == "COPYONLY")
|
||||
{
|
||||
m_CopyOnly = true;
|
||||
}
|
||||
if(args[3] == "ESCAPE_QUOTES")
|
||||
{
|
||||
m_EscapeQuotes = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -102,7 +118,7 @@ void cmConfigureFileCommand::FinalPass()
|
|||
inLine = buffer;
|
||||
if(!m_CopyOnly)
|
||||
{
|
||||
m_Makefile->ExpandVariablesInString(inLine);
|
||||
m_Makefile->ExpandVariablesInString(inLine, m_EscapeQuotes);
|
||||
m_Makefile->RemoveVariablesInString(inLine);
|
||||
// look for special cmakedefine symbol and handle it
|
||||
// is the symbol defined
|
||||
|
|
|
@ -77,13 +77,14 @@ public:
|
|||
virtual const char* GetFullDocumentation()
|
||||
{
|
||||
return
|
||||
"CONFIGURE_FILE(InputFile OutputFile [COPYONLY])\n"
|
||||
"CONFIGURE_FILE(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES])\n"
|
||||
"The Input and Ouput files have to have full paths.\n"
|
||||
"They can also use variables like CMAKE_BINARY_DIR,CMAKE_SOURCE_DIR.\n"
|
||||
"This command replaces any variables in the input file with their\n"
|
||||
"values as determined by CMake. If a variables in not defined, it\n"
|
||||
"will be replaced with nothing. If COPYONLY is passed in, then\n"
|
||||
"then no varible expansion will take place.\n";
|
||||
"They can also use variables like CMAKE_BINARY_DIR,CMAKE_SOURCE_DIR. "
|
||||
"This command replaces any variables in the input file with their "
|
||||
"values as determined by CMake. If a variables in not defined, it "
|
||||
"will be replaced with nothing. If COPYONLY is passed in, then "
|
||||
"then no varible expansion will take place. If ESCAPE_QUOTES is "
|
||||
"passed in then any substitued quotes will be C style escaped.";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,6 +96,7 @@ private:
|
|||
std::string m_InputFile;
|
||||
std::string m_OuputFile;
|
||||
bool m_CopyOnly;
|
||||
bool m_EscapeQuotes;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue