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/cmComputeLinkInformation.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/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 1ec1ba3..4d0d93a 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -301,11 +301,8 @@ void cmComputeLinkInformation::AddItem(std::string const& item, { // Compute the proper name to use to link this library. const char* config = this->Config; - bool implib = this->UseImportLibrary; - bool impexe = (tgt && - tgt->GetType() == cmTarget::EXECUTABLE && - tgt->GetPropertyAsBool("ENABLE_EXPORTS")); - if(impexe && !implib && !this->LoaderFlag) + bool impexe = (tgt && tgt->IsExecutableWithExports()); + if(impexe && !this->UseImportLibrary && !this->LoaderFlag) { // Skip linking to executables on platforms with no import // libraries or loader flags. @@ -325,13 +322,18 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // platform. Add it now. std::string linkItem; linkItem = this->LoaderFlag; - std::string exe = tgt->GetFullPath(config, implib); + std::string exe = tgt->GetFullPath(config, this->UseImportLibrary); linkItem += exe; this->Items.push_back(Item(linkItem, true)); this->Depends.push_back(exe); } else { + // Decide whether to use an import library. + bool implib = + (this->UseImportLibrary && + (impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY)); + // Pass the full path to the target file. std::string lib = tgt->GetFullPath(config, implib); this->Depends.push_back(lib); @@ -950,18 +952,8 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath, // Try to get the soname of the library. Only files with this name // could possibly conflict. - std::string soName; - const char* soname = 0; - if(!target->IsImported()) - { - std::string name; - std::string realName; - std::string impName; - std::string pdbName; - target->GetLibraryNames(name, soName, realName, impName, pdbName, - this->Config); - soname = soName.c_str(); - } + std::string soName = target->GetSOName(this->Config); + const char* soname = soName.empty()? 0 : soName.c_str(); // Add the library runtime entry. this->AddLibraryRuntimeInfo(fullPath, soname); |