BUG: Only one generated Tcl wrapper source was getting added to the package's library.

This commit is contained in:
Brad King 2002-07-26 10:15:04 -04:00
parent 20b1d940a4
commit da9d44f877
2 changed files with 7 additions and 6 deletions

View File

@ -39,6 +39,7 @@ bool cmITKWrapTclCommand::InitialPass(std::vector<std::string> const& argsIn)
cmSystemTools::ExpandListArguments(argsIn, args); cmSystemTools::ExpandListArguments(argsIn, args);
// keep the target name // keep the target name
m_TargetName = args[0]; m_TargetName = args[0];
m_Target = &m_Makefile->GetTargets()[m_TargetName.c_str()];
// Prepare the dependency generator. // Prepare the dependency generator.
m_MakeDepend->SetMakefile(m_Makefile); m_MakeDepend->SetMakefile(m_Makefile);
@ -49,9 +50,6 @@ bool cmITKWrapTclCommand::InitialPass(std::vector<std::string> const& argsIn)
if(!this->CreateCableRule((*i).c_str())) { return false; } if(!this->CreateCableRule((*i).c_str())) { return false; }
} }
// Add the source list to the target.
m_Makefile->GetTargets()[m_TargetName.c_str()].GetSourceLists().push_back(m_TargetName);
return true; return true;
} }
@ -132,16 +130,18 @@ bool cmITKWrapTclCommand::CreateCableRule(const char* configFile)
commandArgs, depends, commandArgs, depends,
outputs, m_TargetName.c_str()); outputs, m_TargetName.c_str());
// Add the generated source to the package's source list. // Add the source to the makefile.
cmSourceFile file; cmSourceFile file;
file.SetName(tclFile.c_str(), outDir.c_str(), "cxx", false); file.SetName(tclFile.c_str(), outDir.c_str(), "cxx", false);
// Set dependency hints. // Set dependency hints.
file.GetDepends().push_back(inFile.c_str()); file.GetDepends().push_back(inFile.c_str());
file.GetDepends().push_back("CableTclFacility/ctCalls.h"); file.GetDepends().push_back("CableTclFacility/ctCalls.h");
m_Makefile->AddSource(file); m_Makefile->AddSource(file);
// Add the generated source to the package's source list.
std::string srcname = file.GetSourceName() + ".cxx"; std::string srcname = file.GetSourceName() + ".cxx";
m_Makefile->AddDefinition(m_TargetName.c_str(), m_Target->GetSourceLists().push_back(srcname);
srcname.c_str());
return true; return true;
} }

View File

@ -60,6 +60,7 @@ public:
cmTypeMacro(cmITKWrapTclCommand, cmCommand); cmTypeMacro(cmITKWrapTclCommand, cmCommand);
protected: protected:
cmStdString m_TargetName; cmStdString m_TargetName;
cmTarget* m_Target;
bool CreateCableRule(const char* configFile); bool CreateCableRule(const char* configFile);
std::string GetCableFromCache() const; std::string GetCableFromCache() const;