diff options
author | Brad King <brad.king@kitware.com> | 2008-02-01 18:08:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-01 18:08:12 (GMT) |
commit | 16186ec18c0654d6fc2a9018553df53390bb9ff2 (patch) | |
tree | b128754f0e3a693e007258e582eeaf3d6110fef7 | |
parent | 15741325e0393ec7a97212cf59efc3d3036c9d7d (diff) | |
download | CMake-16186ec18c0654d6fc2a9018553df53390bb9ff2.zip CMake-16186ec18c0654d6fc2a9018553df53390bb9ff2.tar.gz CMake-16186ec18c0654d6fc2a9018553df53390bb9ff2.tar.bz2 |
BUG: Remove InstallNameFixupPath from cmTarget and cmInstallTargetGenerator.
- Motivation:
- It depended on the order of installation
- It supported only a single destination for each target
- It created directory portions of an install name without user request
- Updated ExportImport test to install targets in an order that expoed
this bug
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 49 | ||||
-rw-r--r-- | Source/cmTarget.h | 13 | ||||
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 16 |
3 files changed, 30 insertions, 48 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 521fa4d..fb27a6d 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -280,8 +280,6 @@ cmInstallTargetGenerator } toDestDirPath += toInstallPath; - this->Target->SetInstallNameFixupPath(toInstallPath.c_str()); - os << indent << "IF(EXISTS \"" << toDestDirPath << "\")\n"; this->AddInstallNamePatchRule(os, indent.Next(), config, toDestDirPath); this->AddChrpathPatchRule(os, indent.Next(), config, toDestDirPath); @@ -394,23 +392,19 @@ cmInstallTargetGenerator cmTarget* tgt = *j; std::string for_build = tgt->GetInstallNameDirForBuildTree(config); std::string for_install = tgt->GetInstallNameDirForInstallTree(config); - std::string fname = this->GetInstallFilename(tgt, config, false, true); + if(for_build != for_install) + { + // The directory portions differ. Append the filename to + // create the mapping. + std::string fname = + this->GetInstallFilename(tgt, config, false, true); - // Map from the build-tree install_name. - for_build += fname; + // Map from the build-tree install_name. + for_build += fname; - // Map to the install-tree install_name. - if (!for_install.empty()) - { + // Map to the install-tree install_name. for_install += fname; - } - else - { - for_install = tgt->GetInstallNameFixupPath(); - } - if(for_build != for_install) - { // Store the mapping entry. install_name_remap[for_build] = for_install; } @@ -421,26 +415,27 @@ cmInstallTargetGenerator std::string new_id; if(this->Target->GetType() == cmTarget::SHARED_LIBRARY) { - std::string for_build = + std::string for_build = this->Target->GetInstallNameDirForBuildTree(config); - std::string for_install = + std::string for_install = this->Target->GetInstallNameDirForInstallTree(config); - std::string fname = - this->GetInstallFilename(this->Target, config, this->ImportLibrary, - true); - for_build += fname; - if (!for_install.empty()) - { - for_install += fname; - } - else + + if(this->Target->IsFrameworkOnApple() && for_install.empty()) { - for_install = this->Target->GetInstallNameFixupPath(); + // Frameworks seem to have an id corresponding to their own full + // path. + // ... + // for_install = fullDestPath_without_DESTDIR_or_name; } + + // If the install name will change on installation set the new id + // on the installed file. if(for_build != for_install) { // Prepare to refer to the install-tree install_name. new_id = for_install; + new_id += this->GetInstallFilename(this->Target, config, + this->ImportLibrary, true); } } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 4d08af6..5f45c88 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -191,18 +191,6 @@ public: bool GetHaveInstallRule() { return this->HaveInstallRule; } void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; } - /** - * Get/Set the path needed for calls to install_name_tool regarding this - * target. Used to support fixing up installed libraries and executables on - * the Mac (including bundles and frameworks). Only used if the target does - * not have an INSTALL_NAME_DIR property. - * See cmInstallTargetGenerator::AddInstallNamePatchRule and callers for - * more information. - */ - std::string GetInstallNameFixupPath() { return this->InstallNameFixupPath; } - void SetInstallNameFixupPath(const char *path) { - this->InstallNameFixupPath = path; } - /** Add a utility on which this project depends. A utility is an executable * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE * commands. It is not a full path nor does it have an extension. @@ -465,7 +453,6 @@ private: std::vector<std::string> LinkDirectories; std::set<cmStdString> LinkDirectoriesEmmitted; bool HaveInstallRule; - std::string InstallNameFixupPath; std::string InstallPath; std::string RuntimeInstallPath; std::string OutputDir; diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 1e6307a..b90330b 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -37,14 +37,6 @@ set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1) # Install and export from install tree. install( TARGETS - testExe2libImp testLib3Imp - EXPORT exp - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib/impl - ARCHIVE DESTINATION lib/impl - ) -install( - TARGETS testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3 testExe2lib EXPORT exp @@ -54,6 +46,14 @@ install( FRAMEWORK DESTINATION Frameworks BUNDLE DESTINATION Applications ) +install( + TARGETS + testExe2libImp testLib3Imp + EXPORT exp + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib/impl + ARCHIVE DESTINATION lib/impl + ) install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp) # Export from build tree. |