From 8609fdb051c5a277b327618070951e443b0b37ae Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Fri, 22 Jun 2001 11:15:18 -0400 Subject: [PATCH] added escape quotes option --- Source/cmConfigureFileCommand.cxx | 18 +++++++++++++++++- Source/cmConfigureFileCommand.h | 14 ++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 6325bfb08..58e40e7b1 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -51,12 +51,28 @@ bool cmConfigureFileCommand::InitialPass(std::vector& 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 diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index 9cb5604b9..bc6390b43 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -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; };