summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-07-26 14:15:04 (GMT)
committerBrad King <brad.king@kitware.com>2002-07-26 14:15:04 (GMT)
commitda9d44f877d4942b63eed343869f94decd3c21b3 (patch)
tree31d573eab5bd1923eff09fdf339ddebe011b2e28 /Source
parent20b1d940a407c4e8184e0aff73fa76ce0dafcb2b (diff)
downloadCMake-da9d44f877d4942b63eed343869f94decd3c21b3.zip
CMake-da9d44f877d4942b63eed343869f94decd3c21b3.tar.gz
CMake-da9d44f877d4942b63eed343869f94decd3c21b3.tar.bz2
BUG: Only one generated Tcl wrapper source was getting added to the package's library.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmITKWrapTclCommand.cxx12
-rw-r--r--Source/cmITKWrapTclCommand.h1
2 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmITKWrapTclCommand.cxx b/Source/cmITKWrapTclCommand.cxx
index 4ec309c..ba28e1b 100644
--- a/Source/cmITKWrapTclCommand.cxx
+++ b/Source/cmITKWrapTclCommand.cxx
@@ -39,6 +39,7 @@ bool cmITKWrapTclCommand::InitialPass(std::vector<std::string> const& argsIn)
cmSystemTools::ExpandListArguments(argsIn, args);
// keep the target name
m_TargetName = args[0];
+ m_Target = &m_Makefile->GetTargets()[m_TargetName.c_str()];
// Prepare the dependency generator.
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; }
}
- // Add the source list to the target.
- m_Makefile->GetTargets()[m_TargetName.c_str()].GetSourceLists().push_back(m_TargetName);
-
return true;
}
@@ -132,16 +130,18 @@ bool cmITKWrapTclCommand::CreateCableRule(const char* configFile)
commandArgs, depends,
outputs, m_TargetName.c_str());
- // Add the generated source to the package's source list.
+ // Add the source to the makefile.
cmSourceFile file;
file.SetName(tclFile.c_str(), outDir.c_str(), "cxx", false);
// Set dependency hints.
file.GetDepends().push_back(inFile.c_str());
file.GetDepends().push_back("CableTclFacility/ctCalls.h");
m_Makefile->AddSource(file);
+
+ // Add the generated source to the package's source list.
std::string srcname = file.GetSourceName() + ".cxx";
- m_Makefile->AddDefinition(m_TargetName.c_str(),
- srcname.c_str());
+ m_Target->GetSourceLists().push_back(srcname);
+
return true;
}
diff --git a/Source/cmITKWrapTclCommand.h b/Source/cmITKWrapTclCommand.h
index 6e52ce4..d554afa 100644
--- a/Source/cmITKWrapTclCommand.h
+++ b/Source/cmITKWrapTclCommand.h
@@ -60,6 +60,7 @@ public:
cmTypeMacro(cmITKWrapTclCommand, cmCommand);
protected:
cmStdString m_TargetName;
+ cmTarget* m_Target;
bool CreateCableRule(const char* configFile);
std::string GetCableFromCache() const;