ENH: made configure file immediate by default for 2.2 or later

This commit is contained in:
Ken Martin 2005-06-13 09:33:38 -04:00
parent 4391edcdd4
commit c9cc368a9d
2 changed files with 15 additions and 5 deletions

View File

@ -30,7 +30,19 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args)
m_OuputFile = args[1]; m_OuputFile = args[1];
m_CopyOnly = false; m_CopyOnly = false;
m_EscapeQuotes = false; m_EscapeQuotes = false;
// for CMake 2.0 and earlier CONFIGURE_FILE defaults to the FinalPass,
// after 2.0 it only does InitialPass
m_Immediate = false; m_Immediate = false;
const char* versionValue
= m_Makefile->GetRequiredDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
if (atof(versionValue) > 2.0)
{
m_Immediate = true;
}
m_AtOnly = false; m_AtOnly = false;
for(unsigned int i=2;i < args.size();++i) for(unsigned int i=2;i < args.size();++i)
{ {

View File

@ -58,8 +58,7 @@ public:
{ {
return return
" CONFIGURE_FILE(InputFile OutputFile\n" " CONFIGURE_FILE(InputFile OutputFile\n"
" [COPYONLY] [ESCAPE_QUOTES]\n" " [COPYONLY] [ESCAPE_QUOTES] [@ONLY])\n"
" [IMMEDIATE] [@ONLY])\n"
"The Input and Ouput files have to have full paths. " "The Input and Ouput files have to have full paths. "
"This command replaces any variables in the input file referenced as " "This command replaces any variables in the input file referenced as "
"${VAR} or @VAR@ with their values as determined by CMake. If a " "${VAR} or @VAR@ with their values as determined by CMake. If a "
@ -67,9 +66,8 @@ public:
"If COPYONLY is specified, then then no variable expansion will take " "If COPYONLY is specified, then then no variable expansion will take "
"place. If ESCAPE_QUOTES is specified in then any substitued quotes " "place. If ESCAPE_QUOTES is specified in then any substitued quotes "
"will be C-style escaped. " "will be C-style escaped. "
"If IMMEDIATE is specified, then the file will be configured with " "The file will be configured with the current values of CMake "
"the current values of CMake variables instead of waiting until the " "variables. If @ONLY is specified, only variables "
"end of CMakeLists processing. If @ONLY is specified, only variables "
"of the form @VAR@ will be replaces and ${VAR} will be ignored. " "of the form @VAR@ will be replaces and ${VAR} will be ignored. "
"This is useful for configuring tcl scripts that use ${VAR}."; "This is useful for configuring tcl scripts that use ${VAR}.";
} }