diff options
author | Brad King <brad.king@kitware.com> | 2006-04-04 15:48:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-04 15:48:19 (GMT) |
commit | 2301a025ea1ed9a61cf0028f88b32f726162fbf7 (patch) | |
tree | 2e9f8ba74c01e98c9b22c846edc34a06865b6ae8 /Source/cmLocalGenerator.cxx | |
parent | cddedaa7d85c1a4ccc3502a6ec56f6e6cdea6f90 (diff) | |
download | CMake-2301a025ea1ed9a61cf0028f88b32f726162fbf7.zip CMake-2301a025ea1ed9a61cf0028f88b32f726162fbf7.tar.gz CMake-2301a025ea1ed9a61cf0028f88b32f726162fbf7.tar.bz2 |
ENH: Added global TargetManifest computation between Configure and Generate steps. This allows generators to know what other targets will exist on disk when the build completes.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 748bfe5..9d65c2b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -391,6 +391,63 @@ void cmLocalGenerator::GenerateInstallRules() } } +//---------------------------------------------------------------------------- +void cmLocalGenerator::GenerateTargetManifest(cmTargetManifest& manifest) +{ + // Collect the set of configuration types. + std::vector<std::string> configNames; + if(const char* configurationTypes = + this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + cmSystemTools::ExpandListArgument(configurationTypes, configNames); + } + else if(const char* buildType = + this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) + { + if(*buildType) + { + configNames.push_back(buildType); + } + } + + // Add our targets to the manifest for each configuration. + cmTargets& targets = this->Makefile->GetTargets(); + for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) + { + cmTarget& target = t->second; + cmTarget::TargetType type = target.GetType(); + if(type == cmTarget::STATIC_LIBRARY || + type == cmTarget::SHARED_LIBRARY || + type == cmTarget::MODULE_LIBRARY || + type == cmTarget::EXECUTABLE) + { + if(configNames.empty()) + { + manifest[""].insert(target.GetFullPath(0, false)); + if(type == cmTarget::SHARED_LIBRARY && + this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) + { + manifest[""].insert(target.GetFullPath(0, true)); + } + } + else + { + for(std::vector<std::string>::iterator ci = configNames.begin(); + ci != configNames.end(); ++ci) + { + const char* config = ci->c_str(); + manifest[config].insert(target.GetFullPath(config, false)); + if(type == cmTarget::SHARED_LIBRARY && + this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) + { + manifest[config].insert(target.GetFullPath(config, true)); + } + } + } + } + } +} + void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, const char* lang, cmSourceFile& source, |