summaryrefslogtreecommitdiffstats
path: root/Source/cmVTKWrapPythonCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-06-30 00:04:28 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-06-30 00:04:28 (GMT)
commit0b88e57e547907701e38ee21f403ce45effff881 (patch)
tree5146b2a806791b12971cc9fb69a961d6a815ef7b /Source/cmVTKWrapPythonCommand.cxx
parent3cfca938da80f3cee7b962c94e54ddbd32316c52 (diff)
downloadCMake-0b88e57e547907701e38ee21f403ce45effff881.zip
CMake-0b88e57e547907701e38ee21f403ce45effff881.tar.gz
CMake-0b88e57e547907701e38ee21f403ce45effff881.tar.bz2
fixed commands that were setting definitions in final pass to set definitions in initial pass
Diffstat (limited to 'Source/cmVTKWrapPythonCommand.cxx')
-rw-r--r--Source/cmVTKWrapPythonCommand.cxx55
1 files changed, 27 insertions, 28 deletions
diff --git a/Source/cmVTKWrapPythonCommand.cxx b/Source/cmVTKWrapPythonCommand.cxx
index 059c34d..be21948 100644
--- a/Source/cmVTKWrapPythonCommand.cxx
+++ b/Source/cmVTKWrapPythonCommand.cxx
@@ -41,7 +41,30 @@ bool cmVTKWrapPythonCommand::InitialPass(std::vector<std::string> const& argsIn)
// keep the library name
m_LibraryName = args[0];
m_SourceList = args[1];
-
+ std::string sourceListValue;
+ // was the list already populated
+ const char *def = m_Makefile->GetDefinition(m_SourceList.c_str());
+ if (def)
+ {
+ sourceListValue = def;
+ sourceListValue += ";";
+ }
+
+ // Create the init file
+ std::string res = m_LibraryName;
+ res += "Init.cxx";
+ this->CreateInitFile(res);
+
+ // add the init file
+ cmSourceFile cfile;
+ cfile.SetIsAnAbstractClass(false);
+ std::string newName = m_LibraryName;
+ newName += "Init";
+ cfile.SetName(newName.c_str(), m_Makefile->GetCurrentOutputDirectory(),
+ "cxx",false);
+ m_Makefile->AddSource(cfile);
+ sourceListValue += newName + ".cxx";
+
// get the list of classes for this library
for(std::vector<std::string>::iterator j = (args.begin() + 2);
j != args.end(); ++j)
@@ -65,9 +88,12 @@ bool cmVTKWrapPythonCommand::InitialPass(std::vector<std::string> const& argsIn)
// add starting depends
file.GetDepends().push_back(hname);
m_WrapClasses.push_back(file);
+ sourceListValue += ";";
+ sourceListValue += newName + ".cxx";
}
}
+ m_Makefile->AddDefinition(m_SourceList.c_str(), sourceListValue.c_str());
return true;
}
@@ -78,32 +104,8 @@ void cmVTKWrapPythonCommand::FinalPass()
std::vector<std::string> depends;
std::string wpython = "${VTK_WRAP_PYTHON_EXE}";
std::string hints = "${VTK_WRAP_HINTS}";
- std::string sourceListValue;
m_Makefile->ExpandVariablesInString(hints);
-
- // was the list already populated
- const char *def = m_Makefile->GetDefinition(m_SourceList.c_str());
- if (def)
- {
- sourceListValue = def;
- sourceListValue += ";";
- }
-
- // Create the init file
- std::string res = m_LibraryName;
- res += "Init.cxx";
- this->CreateInitFile(res);
-
- // add the init file
- cmSourceFile cfile;
- cfile.SetIsAnAbstractClass(false);
- std::string newName = m_LibraryName;
- newName += "Init";
- cfile.SetName(newName.c_str(), m_Makefile->GetCurrentOutputDirectory(),
- "cxx",false);
- m_Makefile->AddSource(cfile);
- sourceListValue += newName + ".cxx";
// wrap all the .h files
depends.push_back(wpython);
@@ -125,14 +127,11 @@ void cmVTKWrapPythonCommand::FinalPass()
}
args.push_back((m_WrapClasses[classNum].IsAnAbstractClass() ? "0" : "1"));
args.push_back(res);
- sourceListValue += ";";
- sourceListValue += m_WrapClasses[classNum].GetSourceName() + ".cxx";
m_Makefile->AddCustomCommand(m_WrapHeaders[classNum].c_str(),
wpython.c_str(), args, depends,
res.c_str(), m_LibraryName.c_str());
}
- m_Makefile->AddDefinition(m_SourceList.c_str(), sourceListValue.c_str());
}
bool cmVTKWrapPythonCommand::CreateInitFile(std::string& res)