diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-07-31 19:32:53 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-07-31 19:32:53 (GMT) |
commit | 42b39099a754ab62b59cea491866e0a6dca079b6 (patch) | |
tree | 5fe5d07cd35660c01bfed091107fef266710f2cc /Source/cmTarget.cxx | |
parent | 0e067f9223d1eeacc11d9c9127e8591093a1bcba (diff) | |
download | CMake-42b39099a754ab62b59cea491866e0a6dca079b6.zip CMake-42b39099a754ab62b59cea491866e0a6dca079b6.tar.gz CMake-42b39099a754ab62b59cea491866e0a6dca079b6.tar.bz2 |
ENH: add support for OBJECT_DEPENDS for visual studio
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index be08f65..af47b2e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -45,6 +45,7 @@ void cmTarget::TraceVSDependencies(std::string projFile, std::queue<std::string> srcFilesToProcess; std::set<std::string> srcFilesQueued; std::string name; + std::vector<cmSourceFile*> newClasses; for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); i != classes.end(); ++i) { @@ -56,7 +57,53 @@ void cmTarget::TraceVSDependencies(std::string projFile, } srcFilesToProcess.push(name); srcFilesQueued.insert(name); + // does this sourcefile have object depends on it? + // If so then add them as well + const char* additionalDeps = (*i)->GetProperty("OBJECT_DEPENDS"); + if (additionalDeps) + { + std::vector<std::string> depends; + cmSystemTools::ExpandListArgument(additionalDeps, depends); + for(std::vector<std::string>::iterator id = depends.begin(); + id != depends.end(); ++id) + { + // if there is a cutom rule to generate that dependency + // then add it to the list + cmSourceFile* outsf = + makefile->GetSourceFileWithOutput(id->c_str()); + // if a source file was found then add it + if (outsf && + (std::find(classes.begin(),classes.end(),outsf) == classes.end()) && + (std::find(newClasses.begin(),newClasses.end(),outsf) == newClasses.end())) + { + // then add the source to this target and add it to the queue + newClasses.push_back(outsf); + name = outsf->GetSourceName(); + if (outsf->GetSourceExtension() != "rule") + { + name += "."; + name += outsf->GetSourceExtension(); + } + std::string temp = + cmSystemTools::GetFilenamePath(outsf->GetFullPath()); + temp += "/"; + temp += name; + // if it hasn't been processed + if (srcFilesQueued.find(temp) == srcFilesQueued.end()) + { + srcFilesToProcess.push(temp); + srcFilesQueued.insert(temp); + } + } + } + } } + for(std::vector<cmSourceFile*>::const_iterator i = newClasses.begin(); + i != newClasses.end(); ++i) + { + classes.push_back(*i); + } + // add in the project file itself srcFilesToProcess.push(projFile); srcFilesQueued.insert(projFile); |