diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-06-19 16:52:16 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-06-19 16:52:16 (GMT) |
commit | 38145ad5a4cceebc17f434e3c1068c8cc5bb5461 (patch) | |
tree | 78650f5ab7a85a37082fcd0b1c15a7f8c840bce4 /Source/cmTarget.cxx | |
parent | b15808caffd9d32caf75ac892a7b149ff3486ab8 (diff) | |
download | CMake-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.cxx | 21 |
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)); + } } } |