summaryrefslogtreecommitdiffstats
path: root/Source/cmConfigureFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-08-03 19:47:19 (GMT)
committerBrad King <brad.king@kitware.com>2001-08-03 19:47:19 (GMT)
commit9cce8359001491aea51ce2effa817fdf5571c4d6 (patch)
treee9ba2ede118846552172a4d882aa9e3c20986f84 /Source/cmConfigureFileCommand.cxx
parentd76f84f70e89a2161d691142a458b403fe4a20af (diff)
downloadCMake-9cce8359001491aea51ce2effa817fdf5571c4d6.zip
CMake-9cce8359001491aea51ce2effa817fdf5571c4d6.tar.gz
CMake-9cce8359001491aea51ce2effa817fdf5571c4d6.tar.bz2
ENH: Added 'IMMEDIATE' option to CONFIGURE_FILE command to force file copy and configuration on the initial pass so that current variable values are used.
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r--Source/cmConfigureFileCommand.cxx38
1 files changed, 24 insertions, 14 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index 58878a5..bf49a82 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -52,33 +52,43 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string>& args)
m_OuputFile = args[1];
m_CopyOnly = false;
m_EscapeQuotes = false;
- if(args.size() >= 3)
+ m_Immediate = false;
+ for(unsigned int i=2;i < args.size();++i)
{
- if(args[2] == "COPYONLY")
+ if(args[i] == "COPYONLY")
{
- m_CopyOnly = true;
+ m_CopyOnly = true;
}
- if(args[2] == "ESCAPE_QUOTES")
+ else if(args[i] == "ESCAPE_QUOTES")
{
- m_EscapeQuotes = true;
+ m_EscapeQuotes = true;
}
- }
- if(args.size() >= 4)
- {
- if(args[3] == "COPYONLY")
- {
- m_CopyOnly = true;
- }
- if(args[3] == "ESCAPE_QUOTES")
+ else if(args[i] == "IMMEDIATE")
{
- m_EscapeQuotes = true;
+ m_Immediate = true;
}
}
+
+ // If we were told to copy the file immediately, then do it on the
+ // first pass (now).
+ if(m_Immediate)
+ {
+ this->ConfigureFile();
+ }
+
return true;
}
void cmConfigureFileCommand::FinalPass()
{
+ if(!m_Immediate)
+ {
+ this->ConfigureFile();
+ }
+}
+
+void cmConfigureFileCommand::ConfigureFile()
+{
m_Makefile->ExpandVariablesInString(m_InputFile);
m_Makefile->ExpandVariablesInString(m_OuputFile);
cmSystemTools::ConvertToUnixSlashes(m_OuputFile);