summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-06-19 16:52:16 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-06-19 16:52:16 (GMT)
commit38145ad5a4cceebc17f434e3c1068c8cc5bb5461 (patch)
tree78650f5ab7a85a37082fcd0b1c15a7f8c840bce4 /Source/cmTarget.cxx
parentb15808caffd9d32caf75ac892a7b149ff3486ab8 (diff)
downloadCMake-38145ad5a4cceebc17f434e3c1068c8cc5bb5461.zip
CMake-38145ad5a4cceebc17f434e3c1068c8cc5bb5461.tar.gz
CMake-38145ad5a4cceebc17f434e3c1068c8cc5bb5461.tar.bz2
modified create test source to create a vector
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index bbb861c..f24da58 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -50,12 +50,21 @@ void cmTarget::GenerateSourceFilesFromSourceLists( cmMakefile &mf)
// if one wasn't found then assume it is a single class
else
{
- cmSourceFile file;
- file.SetIsAnAbstractClass(false);
- file.SetName(temps.c_str(), mf.GetCurrentDirectory(),
- mf.GetSourceExtensions(),
- mf.GetHeaderExtensions());
- m_SourceFiles.push_back(mf.AddSource(file));
+ // if the source file is already in the makefile, use it
+ if (mf.GetSource(temps.c_str()))
+ {
+ m_SourceFiles.push_back(mf.GetSource(temps.c_str()));
+ }
+ // otherwise try to create it
+ else
+ {
+ cmSourceFile file;
+ file.SetIsAnAbstractClass(false);
+ file.SetName(temps.c_str(), mf.GetCurrentDirectory(),
+ mf.GetSourceExtensions(),
+ mf.GetHeaderExtensions());
+ m_SourceFiles.push_back(mf.AddSource(file));
+ }
}
}