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/cmVTKWrapPythonCommand.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/cmVTKWrapPythonCommand.cxx')
-rw-r--r-- | Source/cmVTKWrapPythonCommand.cxx | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/Source/cmVTKWrapPythonCommand.cxx b/Source/cmVTKWrapPythonCommand.cxx index 3bde306..b9aa32d 100644 --- a/Source/cmVTKWrapPythonCommand.cxx +++ b/Source/cmVTKWrapPythonCommand.cxx @@ -102,14 +102,12 @@ void cmVTKWrapPythonCommand::FinalPass() // first we add the rules for all the .h to Python.cxx files size_t lastClass = m_WrapClasses.size(); std::vector<std::string> depends; - std::string wpython = "${VTK_WRAP_PYTHON_EXE}"; - std::string hints = "${VTK_WRAP_HINTS}"; - - m_Makefile->ExpandVariablesInString(hints); + const char* wpython = m_Makefile->GetRequiredDefinition("VTK_WRAP_PYTHON_EXE"); + const char* hints = m_Makefile->GetDefinition("VTK_WRAP_HINTS"); // wrap all the .h files depends.push_back(wpython); - if (strcmp("${VTK_WRAP_HINTS}",hints.c_str())) + if(hints) { depends.push_back(hints); } @@ -119,18 +117,27 @@ void cmVTKWrapPythonCommand::FinalPass() std::string res = m_Makefile->GetCurrentOutputDirectory(); res += "/"; res += m_WrapClasses[classNum].GetSourceName() + ".cxx"; - std::vector<std::string> args; - args.push_back(m_WrapHeaders[classNum]); - if (strcmp("${VTK_WRAP_HINTS}",hints.c_str())) + cmCustomCommandLine commandLine; + commandLine.push_back(wpython); + 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")); - args.push_back(res); - - m_Makefile->AddCustomCommand(m_WrapHeaders[classNum].c_str(), - wpython.c_str(), args, depends, - res.c_str(), m_LibraryName.c_str()); + commandLine.push_back((m_WrapClasses[classNum].GetPropertyAsBool("ABSTRACT") ? "0" : "1")); + 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); } } |