diff options
author | Brad King <brad.king@kitware.com> | 2004-03-03 23:18:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-03-03 23:18:47 (GMT) |
commit | 1dd718457fe1d410314d9443fa5d82462c5ae8ea (patch) | |
tree | 8b72677237a10327cdcde6dbedbe7b0191260b79 /Source/cmConfigureFileCommand.cxx | |
parent | be45b5d20556ce5863fa0fc3a50b0a2b270a0a0f (diff) | |
download | CMake-1dd718457fe1d410314d9443fa5d82462c5ae8ea.zip CMake-1dd718457fe1d410314d9443fa5d82462c5ae8ea.tar.gz CMake-1dd718457fe1d410314d9443fa5d82462c5ae8ea.tar.bz2 |
ENH: Moved variable and #cmakedefine replacement from cmConfigureFileCommand.cxx to a ConfigureString method on cmMakefile. This will give other commands access to the configuration code.
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r-- | Source/cmConfigureFileCommand.cxx | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 3bf97c8..b63e863 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -110,33 +110,12 @@ void cmConfigureFileCommand::ConfigureFile() // now copy input to output and expand variables in the // input file at the same time std::string inLine; - cmsys::RegularExpression cmdefine("#cmakedefine[ \t]*([A-Za-z_0-9]*)"); + std::string outLine; while( cmSystemTools::GetLineFromStream(fin, inLine) ) { - m_Makefile->ExpandVariablesInString(inLine, m_EscapeQuotes, m_AtOnly); - m_Makefile->RemoveVariablesInString(inLine, m_AtOnly); - // look for special cmakedefine symbol and handle it - // is the symbol defined - if (cmdefine.find(inLine)) - { - const char *def = m_Makefile->GetDefinition(cmdefine.match(1).c_str()); - if(!cmSystemTools::IsOff(def)) - { - cmSystemTools::ReplaceString(inLine, - "#cmakedefine", "#define"); - fout << inLine << "\n"; - } - else - { - cmSystemTools::ReplaceString(inLine, - "#cmakedefine", "#undef"); - fout << "/* " << inLine << " */\n"; - } - } - else - { - fout << inLine << "\n"; - } + outLine = ""; + m_Makefile->ConfigureString(inLine, outLine, m_AtOnly, m_EscapeQuotes); + fout << outLine.c_str() << "\n"; } // close the files before attempting to copy fin.close(); |