diff options
author | Brad King <brad.king@kitware.com> | 2008-02-06 19:20:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-06 19:20:36 (GMT) |
commit | 9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9 (patch) | |
tree | 91922579fd8e7264d435c8492e775fe777db611f /Source/cmInstallTargetGenerator.cxx | |
parent | afad12431371d9a725b9a85db39f8c4da37fabaf (diff) | |
download | CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.zip CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.gz CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.bz2 |
ENH: Improve exporting/importing of targets
- Use real name instead of link for location of versioned targets
- Error when a target is exported multiple times
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index c1aa413..c8e00d5 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -144,10 +144,10 @@ cmInstallTargetGenerator Indent const& indent) { // Compute the full path to the main installed file for this target. + NameType nameType = this->ImportLibrary? NameImplib : NameNormal; std::string toInstallPath = this->GetInstallDestination(); toInstallPath += "/"; - toInstallPath += this->GetInstallFilename(this->Target, config, - this->ImportLibrary, false); + toInstallPath += this->GetInstallFilename(this->Target, config, nameType); // Track whether post-install operations should be added to the // script. @@ -194,8 +194,8 @@ cmInstallTargetGenerator // Need to apply install_name_tool and stripping to binary // inside bundle. toInstallPath += ".app/Contents/MacOS/"; - toInstallPath += this->GetInstallFilename(this->Target, config, - this->ImportLibrary, false); + toInstallPath += + this->GetInstallFilename(this->Target, config, nameType); literal_args += " USE_SOURCE_PERMISSIONS"; } else @@ -250,7 +250,7 @@ cmInstallTargetGenerator // inside framework. toInstallPath += ".framework/"; toInstallPath += this->GetInstallFilename(this->Target, config, - this->ImportLibrary, false); + NameNormal); literal_args += " USE_SOURCE_PERMISSIONS"; } @@ -369,16 +369,16 @@ cmInstallTargetGenerator std::string cmInstallTargetGenerator::GetInstallFilename(const char* config) const { + NameType nameType = this->ImportLibrary? NameImplib : NameNormal; return cmInstallTargetGenerator::GetInstallFilename(this->Target, config, - this->ImportLibrary, false); + nameType); } //---------------------------------------------------------------------------- std::string cmInstallTargetGenerator::GetInstallFilename(cmTarget* target, const char* config, - bool implib, - bool useSOName) + NameType nameType) { std::string fname; // Compute the name of the library. @@ -391,11 +391,16 @@ std::string cmInstallTargetGenerator::GetInstallFilename(cmTarget* target, target->GetExecutableNames(targetName, targetNameReal, targetNameImport, targetNamePDB, config); - if(implib) + if(nameType == NameImplib) { // Use the import library name. fname = targetNameImport; } + else if(nameType == NameReal) + { + // Use the canonical name. + fname = targetNameReal; + } else { // Use the canonical name. @@ -411,16 +416,21 @@ std::string cmInstallTargetGenerator::GetInstallFilename(cmTarget* target, std::string targetNamePDB; target->GetLibraryNames(targetName, targetNameSO, targetNameReal, targetNameImport, targetNamePDB, config); - if(implib) + if(nameType == NameImplib) { // Use the import library name. fname = targetNameImport; } - else if(useSOName) + else if(nameType == NameSO) { // Use the soname. fname = targetNameSO; } + else if(nameType == NameReal) + { + // Use the real name. + fname = targetNameReal; + } else { // Use the canonical name. @@ -474,7 +484,7 @@ cmInstallTargetGenerator // The directory portions differ. Append the filename to // create the mapping. std::string fname = - this->GetInstallFilename(tgt, config, false, true); + this->GetInstallFilename(tgt, config, NameSO); // Map from the build-tree install_name. for_build += fname; @@ -511,8 +521,7 @@ cmInstallTargetGenerator { // Prepare to refer to the install-tree install_name. new_id = for_install; - new_id += this->GetInstallFilename(this->Target, config, - this->ImportLibrary, true); + new_id += this->GetInstallFilename(this->Target, config, NameSO); } } |