diff options
author | Brad King <brad.king@kitware.com> | 2008-01-28 13:38:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-28 13:38:36 (GMT) |
commit | 5594ad488576a77d9c6b8c3c1999a04fb4e6867d (patch) | |
tree | f22726476b6eaaf3832e48c185fe3c112601db17 /Source/cmGlobalGenerator.cxx | |
parent | a7cb9d1120c0555f1da67dd585bd1b4fd16d389d (diff) | |
download | CMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.zip CMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.tar.gz CMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.tar.bz2 |
ENH: Updated exporting and importing of targets to support libraries and configurations.
- Created cmExportFileGenerator hierarchy to implement export file generation
- Installed exports use per-config import files loaded by a central one.
- Include soname of shared libraries in import information
- Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands
- Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators
- Import files compute the installation prefix relative to their location when loaded
- Add mapping of importer configurations to importee configurations
- Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries
- Scope IMPORTED targets within directories to isolate them
- Place all properties created by import files in the IMPORTED namespace
- Document INSTALL(EXPORT) and EXPORT() commands.
- Document IMPORTED signature of add_executable and add_library
- Enable finding of imported targets in cmComputeLinkDepends
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 448d457..6c1af53 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -25,7 +25,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmVersion.h" -#include "cmInstallExportGenerator.h" +#include "cmExportInstallFileGenerator.h" #include <cmsys/Directory.hxx> @@ -693,7 +693,6 @@ void cmGlobalGenerator::Configure() this->LocalGenerators.clear(); this->TargetDependencies.clear(); this->TotalTargets.clear(); - this->ImportedTotalTargets.clear(); this->LocalGeneratorToTargetMap.clear(); this->ProjectMap.clear(); @@ -1321,9 +1320,8 @@ cmLocalGenerator* cmGlobalGenerator::FindLocalGenerator(const char* start_dir) //---------------------------------------------------------------------------- -cmTarget* cmGlobalGenerator::FindTarget(const char* project, - const char* name, - bool useImportedTargets) +cmTarget* +cmGlobalGenerator::FindTarget(const char* project, const char* name) { // if project specific if(project) @@ -1331,8 +1329,7 @@ cmTarget* cmGlobalGenerator::FindTarget(const char* project, std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project]; for(unsigned int i = 0; i < gens->size(); ++i) { - cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name, - useImportedTargets); + cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name); if(ret) { return ret; @@ -1348,16 +1345,6 @@ cmTarget* cmGlobalGenerator::FindTarget(const char* project, { return i->second; } - - if ( useImportedTargets ) - { - std::map<cmStdString,cmTarget *>::iterator importedTarget = - this->ImportedTotalTargets.find ( name ); - if ( importedTarget != this->ImportedTotalTargets.end() ) - { - return importedTarget->second; - } - } } return 0; } @@ -1370,7 +1357,7 @@ bool cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) return true; } - if(cmTarget* tgt = this->FindTarget(0, libname.c_str(), true)) + if(cmTarget* tgt = this->FindTarget(0, libname.c_str())) { if(tgt->GetType() == cmTarget::SHARED_LIBRARY && tgt->GetPropertyAsBool("FRAMEWORK")) @@ -1758,12 +1745,12 @@ cmGlobalGenerator::ConsiderTargetDepends(cmTarget const* depender, { // Check the target's makefile first. cmTarget const* dependee = - depender->GetMakefile()->FindTarget(dependee_name, false); + depender->GetMakefile()->FindTarget(dependee_name); // Then search globally. if(!dependee) { - dependee = this->FindTarget(0, dependee_name, false); + dependee = this->FindTarget(0, dependee_name); } // If not found then skip then the dependee. @@ -1842,14 +1829,8 @@ cmGlobalGenerator void cmGlobalGenerator::AddTarget(cmTargets::value_type &v) { - if (v.second.IsImported()) - { - this->ImportedTotalTargets[v.first] = &v.second; - } - else - { - this->TotalTargets[v.first] = &v.second; - } + assert(!v.second.IsImported()); + this->TotalTargets[v.first] = &v.second; } void cmGlobalGenerator::SetExternalMakefileProjectGenerator( |