summaryrefslogtreecommitdiff
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-17 17:21:52 -0400
committerAlexander Neundorf <neundorf@kde.org>2007-05-17 17:21:52 -0400
commitb47807fc15a35c1f9f53842b17ec283c2d3a7778 (patch)
treed56d6b7d1b89df82bc3dbb2d886032fb7edfd7de /Source/cmInstallTargetGenerator.cxx
parentfc07a8c353872ebcd4482589e02e6ef17786b02b (diff)
downloadcmake-b47807fc15a35c1f9f53842b17ec283c2d3a7778.tar.gz
STYLE: fix indentation
ENH: add hack to make new cmake work with older existing cmake build trees Alex
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx32
1 files changed, 23 insertions, 9 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index bd3f864320..f3d04ef19b 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -172,19 +172,18 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
// Fix the install_name settings in installed binaries.
if((type == cmTarget::SHARED_LIBRARY ||
type == cmTarget::MODULE_LIBRARY ||
- type == cmTarget::EXECUTABLE) &&
- this->Target->GetMakefile()->IsSet("CMAKE_INSTALL_NAME_TOOL"))
+ type == cmTarget::EXECUTABLE))
{
this->AddInstallNamePatchRule(os, destination.c_str());
}
- std::string destinationFilename = destination;
- destinationFilename += "/";
- destinationFilename += cmSystemTools::GetFilenameName(fromFile);
+ std::string destinationFilename = destination;
+ destinationFilename += "/";
+ destinationFilename += cmSystemTools::GetFilenameName(fromFile);
- this->AddRanlibRule(os, type, destinationFilename);
+ this->AddRanlibRule(os, type, destinationFilename);
- this->AddStripRule(os, destinationFilename);
+ this->AddStripRule(os, destinationFilename);
}
//----------------------------------------------------------------------------
@@ -347,6 +346,22 @@ void cmInstallTargetGenerator
::AddInstallNamePatchRule(std::ostream& os,
const char* destination)
{
+ std::string installNameTool = this->Target->GetMakefile()->GetDefinition(
+ "CMAKE_INSTALL_NAME_TOOL");
+
+ // hack: if a new cmake runs on an old build tree, CMAKE_INSTALL_NAME_TOOL
+ // isn't in the cache, because it was simply hardcoded. To make this work
+ // adjust it here.
+ if((this->Target->GetMakefile()->IsOn("APPLE")) && (!installNameTool.size()))
+ {
+ installNameTool = "install_name_tool";
+ }
+
+ if(!installNameTool.size())
+ {
+ return;
+ }
+
// Build a map of build-tree install_name to install-tree install_name for
// shared libraries linked to this target.
std::map<cmStdString, cmStdString> install_name_remap;
@@ -425,8 +440,7 @@ void cmInstallTargetGenerator
component_test += this->Component;
component_test += ")$\"";
os << "IF(" << component_test << ")\n";
- os << " EXECUTE_PROCESS(COMMAND \"";
- os <<this->Target->GetMakefile()->GetDefinition("CMAKE_INSTALL_NAME_TOOL");
+ os << " EXECUTE_PROCESS(COMMAND \"" << installNameTool;
os << "\"";
if(!new_id.empty())
{