diff options
author | Brad King <brad.king@kitware.com> | 2005-02-22 15:32:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-22 15:32:44 (GMT) |
commit | 39af9ee1e496db77849015541f687897ed819a56 (patch) | |
tree | 79bd7c1765408c80822dc9b87853bdac24704332 /Source/cmVTKWrapTclCommand.cxx | |
parent | 4d30cb309cc0cd191e89a7969599b79dea111a08 (diff) | |
download | CMake-39af9ee1e496db77849015541f687897ed819a56.zip CMake-39af9ee1e496db77849015541f687897ed819a56.tar.gz CMake-39af9ee1e496db77849015541f687897ed819a56.tar.bz2 |
ENH: Updated implementation of custom commands. Multiple command lines are now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues.
Diffstat (limited to 'Source/cmVTKWrapTclCommand.cxx')
-rw-r--r-- | Source/cmVTKWrapTclCommand.cxx | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/Source/cmVTKWrapTclCommand.cxx b/Source/cmVTKWrapTclCommand.cxx index b1e4d1a..2daad71 100644 --- a/Source/cmVTKWrapTclCommand.cxx +++ b/Source/cmVTKWrapTclCommand.cxx @@ -144,35 +144,42 @@ void cmVTKWrapTclCommand::FinalPass() // first we add the rules for all the .h to Tcl.cxx files size_t lastClass = m_WrapClasses.size(); std::vector<std::string> depends; - std::string wtcl = "${VTK_WRAP_TCL_EXE}"; - std::string hints = "${VTK_WRAP_HINTS}"; - - m_Makefile->ExpandVariablesInString(hints); + const char* wtcl = m_Makefile->GetRequiredDefinition("VTK_WRAP_TCL_EXE"); + const char* hints = m_Makefile->GetDefinition("VTK_WRAP_HINTS"); // wrap all the .h files depends.push_back(wtcl); - if (strcmp("${VTK_WRAP_HINTS}",hints.c_str())) + if(hints) { depends.push_back(hints); } for(size_t classNum = 0; classNum < lastClass; classNum++) { m_Makefile->AddSource(m_WrapClasses[classNum]); - std::vector<std::string> args; - args.push_back(m_WrapHeaders[classNum]); - if (strcmp("${VTK_WRAP_HINTS}",hints.c_str())) + cmCustomCommandLine commandLine; + commandLine.push_back(wtcl); + commandLine.push_back(m_WrapHeaders[classNum]); + if(hints) { - args.push_back(hints); + commandLine.push_back(hints); } - args.push_back((m_WrapClasses[classNum].GetPropertyAsBool("ABSTRACT") ? "0" : "1")); + commandLine.push_back((m_WrapClasses[classNum].GetPropertyAsBool("ABSTRACT") ? "0" : "1")); std::string res = m_Makefile->GetCurrentOutputDirectory(); res += "/"; res += m_WrapClasses[classNum].GetSourceName() + ".cxx"; - args.push_back(res); - - m_Makefile->AddCustomCommand(m_WrapHeaders[classNum].c_str(), - wtcl.c_str(), args, depends, - res.c_str(), m_LibraryName.c_str()); + commandLine.push_back(res); + + cmCustomCommandLines commandLines; + commandLines.push_back(commandLine); + std::vector<std::string> outputs; + outputs.push_back(res); + const char* no_comment = 0; + m_Makefile->AddCustomCommandOldStyle(m_LibraryName.c_str(), + outputs, + depends, + m_WrapHeaders[classNum].c_str(), + commandLines, + no_comment); } } |