diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-06-24 19:24:30 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-06-24 19:24:30 (GMT) |
commit | 840389b64f54b1b239df4b17c329e1e79dfddd42 (patch) | |
tree | d4cf72de143194de5dd09c2640782f1eb9017bce /Source/cmLocalVisualStudio6Generator.cxx | |
parent | e315bff47b144764bc9202b707c82d48298bab25 (diff) | |
download | CMake-840389b64f54b1b239df4b17c329e1e79dfddd42.zip CMake-840389b64f54b1b239df4b17c329e1e79dfddd42.tar.gz CMake-840389b64f54b1b239df4b17c329e1e79dfddd42.tar.bz2 |
moved depend code into cmTarget
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 95 |
1 files changed, 8 insertions, 87 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index c76a629..0d6a830 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -20,7 +20,6 @@ #include "cmSystemTools.h" #include "cmSourceFile.h" #include "cmCacheManager.h" -#include <queue> #include <cmsys/RegularExpression.hxx> @@ -225,9 +224,6 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, const char *libName, cmTarget &target) { - // We may be modifying the source groups temporarily, so make a copy. - std::vector<cmSourceGroup> sourceGroups = m_Makefile->GetSourceGroups(); - // if we should add regen rule then... const char *suppRegenRule = m_Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION"); @@ -235,92 +231,17 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, { this->AddDSPBuildRule(); } + + // trace the visual studio dependencies + std::string name = libName; + name += ".dsp.cmake"; + target.TraceVSDependencies(name, m_Makefile); + // We may be modifying the source groups temporarily, so make a copy. + std::vector<cmSourceGroup> sourceGroups = m_Makefile->GetSourceGroups(); + // get the classes from the source lists then add them to the groups std::vector<cmSourceFile*> & classes = target.GetSourceFiles(); - // use a deck to keep track of processed source files - std::queue<std::string> srcFilesToProcess; - std::string name; - for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); - i != classes.end(); ++i) - { - name = (*i)->GetSourceName(); - if ((*i)->GetSourceExtension() != "rule") - { - name += "."; - name += (*i)->GetSourceExtension(); - } - srcFilesToProcess.push(name); - } - name = libName; - name += ".dsp.cmake"; - srcFilesToProcess.push(name); - // add in the library depends for cusotm targets - if (target.GetType() == cmTarget::UTILITY) - { - for (std::vector<cmCustomCommand>::iterator ic = - target.GetPostBuildCommands().begin(); - ic != target.GetPostBuildCommands().end(); ++ic) - { - cmCustomCommand &c = *ic; - for (std::vector<std::string>::iterator i = c.GetDepends().begin(); - i != c.GetDepends().end(); ++i) - { - srcFilesToProcess.push(*i); - } - } - } - while (!srcFilesToProcess.empty()) - { - // is this source the output of a custom command - cmSourceFile* outsf = - m_Makefile->GetSourceFileWithOutput(srcFilesToProcess.front().c_str()); - if (outsf) - { - // is it not already in the target? - if (std::find(classes.begin(),classes.end(),outsf) == classes.end()) - { - // then add the source to this target and add it to the queue - classes.push_back(outsf); - std::string name = outsf->GetSourceName(); - if (outsf->GetSourceExtension() != "rule") - { - name += "."; - name += outsf->GetSourceExtension(); - } - std::string temp = - cmSystemTools::GetFilenamePath(outsf->GetFullPath()); - temp += "/"; - temp += name; - srcFilesToProcess.push(temp); - } - // add its dependencies to the list to check - unsigned int i; - for (i = 0; i < outsf->GetCustomCommand()->GetDepends().size(); ++i) - { - std::string dep = cmSystemTools::GetFilenameName( - outsf->GetCustomCommand()->GetDepends()[i]); - if (cmSystemTools::GetFilenameLastExtension(dep) == ".exe") - { - dep = cmSystemTools::GetFilenameWithoutLastExtension(dep); - } - // watch for target dependencies, - std::string libPath = dep + "_CMAKE_PATH"; - const char* cacheValue = m_Makefile->GetDefinition(libPath.c_str()); - if (cacheValue) - { - // add the depend as a utility on the target - target.AddUtility(dep.c_str()); - } - else - { - srcFilesToProcess.push(outsf->GetCustomCommand()->GetDepends()[i]); - } - } - } - // finished with this SF move to the next - srcFilesToProcess.pop(); - } // now all of the source files have been properly assigned to the target // now stick them into source groups using the reg expressions |