summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFilesCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-06-27 19:57:09 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-06-27 19:57:09 (GMT)
commit44a7cd55ff126412d8ba8b82739a1bee132c62a1 (patch)
tree533de5563331136062407c254c05024bb5b91632 /Source/cmSourceFilesCommand.cxx
parenta1a05a5fbcd0d34aa5ab0dde7da2ba4c5082916a (diff)
downloadCMake-44a7cd55ff126412d8ba8b82739a1bee132c62a1.zip
CMake-44a7cd55ff126412d8ba8b82739a1bee132c62a1.tar.gz
CMake-44a7cd55ff126412d8ba8b82739a1bee132c62a1.tar.bz2
removed all source lists from the system and made them vectors. Also appended _CMAKE_PATH to the end of the automatic cache entries for executables and libraries. Odds of all these changes working are slim but cmake builds and passes all its tests. VTK40 starts building
Diffstat (limited to 'Source/cmSourceFilesCommand.cxx')
-rw-r--r--Source/cmSourceFilesCommand.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/cmSourceFilesCommand.cxx b/Source/cmSourceFilesCommand.cxx
index 0024f9e..63d06e5 100644
--- a/Source/cmSourceFilesCommand.cxx
+++ b/Source/cmSourceFilesCommand.cxx
@@ -34,8 +34,16 @@ bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
}
std::vector<std::string> args;
cmSystemTools::ExpandListArguments(argsIn, args);
-
+ std::string sourceListValue;
+
+ // was the list already populated
std::string name = args[0];
+ const char *def = m_Makefile->GetDefinition(name.c_str());
+ if (def)
+ {
+ sourceListValue = def;
+ }
+
int generated = 0;
@@ -54,8 +62,12 @@ bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
if(sf)
{
// if the source file is already in the makefile,
- // then add the pointer to the source list without creating a cmSourceFile
- m_Makefile->GetSources()[name].push_back(sf);
+ // then add the pointer to the source list without creating cmSourceFile
+ if (sourceListValue.size() > 0)
+ {
+ sourceListValue += ";";
+ }
+ sourceListValue += copy;
continue;
}
cmSourceFile file;
@@ -79,11 +91,13 @@ bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
}
else
{
- file.SetName(name_no_ext.c_str(), m_Makefile->GetCurrentOutputDirectory(),
+ file.SetName(name_no_ext.c_str(),
+ m_Makefile->GetCurrentOutputDirectory(),
ext.c_str(), false);
}
}
else
+ {
// if this is a full path then
if((path.size() && path[0] == '/') ||
(path.size() > 1 && path[1] == ':'))
@@ -99,9 +113,16 @@ bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions());
}
- m_Makefile->AddSource(file, name.c_str());
+ }
+ m_Makefile->AddSource(file);
+ if (sourceListValue.size() > 0)
+ {
+ sourceListValue += ";";
+ }
+ sourceListValue += copy;
}
+ m_Makefile->AddDefinition(name.c_str(), sourceListValue.c_str());
return true;
}