summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-08 17:03:47 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-08 17:03:47 (GMT)
commita3a046643aeb6244ac71a3cd645239099c6345f3 (patch)
treec6fc86af7356909f5b29d939ce89cf4235cc1da0 /Source
parent6ef56f777803ac6e90699a12636d0133b94b9312 (diff)
downloadCMake-a3a046643aeb6244ac71a3cd645239099c6345f3.zip
CMake-a3a046643aeb6244ac71a3cd645239099c6345f3.tar.gz
CMake-a3a046643aeb6244ac71a3cd645239099c6345f3.tar.bz2
ENH: Pass config to cmTarget RPATH install methods
This passes the build configuration to cmTarget methods IsChrpathUsed and NeedRelinkBeforeInstall. Later these methods will use the value.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx7
-rw-r--r--Source/cmInstallTargetGenerator.cxx6
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx4
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTarget.h4
8 files changed, 18 insertions, 16 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 7be0d85..4ca6817 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -315,7 +315,7 @@ cmComputeLinkInformation
this->RuntimeAlways =
(this->Makefile->
GetSafeDefinition("CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH"));
- this->RuntimeUseChrpath = this->Target->IsChrpathUsed();
+ this->RuntimeUseChrpath = this->Target->IsChrpathUsed(config);
// Get options needed to help find dependent libraries.
std::string rlVar = "CMAKE_";
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6538936..14a7e16 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -451,7 +451,8 @@ cmGlobalUnixMakefileGenerator3
{
// Add this to the list of depends rules in this directory.
if((!check_all || !l->second.GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
- (!check_relink || l->second.NeedRelinkBeforeInstall()))
+ (!check_relink ||
+ l->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str())))
{
std::string tname = lg->GetRelativeTargetDirectory(l->second);
tname += "/";
@@ -659,7 +660,7 @@ cmGlobalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before
// installation.
- if(t->second.NeedRelinkBeforeInstall())
+ if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
makeTargetName = lg->GetRelativeTargetDirectory(t->second);
makeTargetName += "/preinstall";
@@ -829,7 +830,7 @@ cmGlobalUnixMakefileGenerator3
t->second.GetName(), depends, commands, true);
// Add rules to prepare the target for installation.
- if(t->second.NeedRelinkBeforeInstall())
+ if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
localName = lg->GetRelativeTargetDirectory(t->second);
localName += "/preinstall";
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index dc3b139..44f3b04 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -69,7 +69,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
{
// Compute the build tree directory from which to copy the target.
std::string fromDirConfig;
- if(this->Target->NeedRelinkBeforeInstall())
+ if(this->Target->NeedRelinkBeforeInstall(config))
{
fromDirConfig = this->Target->GetMakefile()->GetStartOutputDirectory();
fromDirConfig += cmake::GetCMakeFilesDirectory();
@@ -529,7 +529,7 @@ cmInstallTargetGenerator
const char* config, std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
- if(this->ImportLibrary || !this->Target->IsChrpathUsed())
+ if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
{
return;
}
@@ -560,7 +560,7 @@ cmInstallTargetGenerator
const char* config, std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
- if(this->ImportLibrary || !this->Target->IsChrpathUsed())
+ if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
{
return;
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index b5779bc..923e43f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -372,7 +372,7 @@ void cmLocalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before
// installation.
- if(t->second.NeedRelinkBeforeInstall())
+ if(t->second.NeedRelinkBeforeInstall(this->ConfigurationName.c_str()))
{
makeTargetName = this->GetRelativeTargetDirectory(t->second);
makeTargetName += "/preinstall";
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index cebdf59..e9ac80c 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -60,7 +60,7 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
// write the link rules
this->WriteExecutableRule(false);
- if(this->Target->NeedRelinkBeforeInstall())
+ if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
{
// Write rules to link an installable version of the target.
this->WriteExecutableRule(true);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 00935b8..9c92824 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -72,7 +72,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
break;
case cmTarget::SHARED_LIBRARY:
this->WriteSharedLibraryRules(false);
- if(this->Target->NeedRelinkBeforeInstall())
+ if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
{
// Write rules to link an installable version of the target.
this->WriteSharedLibraryRules(true);
@@ -80,7 +80,7 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
break;
case cmTarget::MODULE_LIBRARY:
this->WriteModuleLibraryRules(false);
- if(this->Target->NeedRelinkBeforeInstall())
+ if(this->Target->NeedRelinkBeforeInstall(this->ConfigName))
{
// Write rules to link an installable version of the target.
this->WriteModuleLibraryRules(true);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 58cf24e..4003190 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3025,7 +3025,7 @@ bool cmTarget::HaveInstallTreeRPATH()
}
//----------------------------------------------------------------------------
-bool cmTarget::NeedRelinkBeforeInstall()
+bool cmTarget::NeedRelinkBeforeInstall(const char* config)
{
// Only executables and shared libraries can have an rpath and may
// need relinking.
@@ -3056,7 +3056,7 @@ bool cmTarget::NeedRelinkBeforeInstall()
}
// If chrpath is going to be used no relinking is needed.
- if(this->IsChrpathUsed())
+ if(this->IsChrpathUsed(config))
{
return false;
}
@@ -3349,7 +3349,7 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsChrpathUsed()
+bool cmTarget::IsChrpathUsed(const char* config)
{
#if defined(CMAKE_USE_ELF_PARSER)
// Only certain target types have an rpath.
@@ -3405,6 +3405,7 @@ bool cmTarget::IsChrpathUsed()
}
}
#endif
+ static_cast<void>(config);
return false;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 46c268e..4ce6b30 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -353,13 +353,13 @@ public:
/**
* Compute whether this target must be relinked before installing.
*/
- bool NeedRelinkBeforeInstall();
+ bool NeedRelinkBeforeInstall(const char* config);
bool HaveBuildTreeRPATH();
bool HaveInstallTreeRPATH();
/** Return true if builtin chrpath will work for this target */
- bool IsChrpathUsed();
+ bool IsChrpathUsed(const char* config);
std::string GetInstallNameDirForBuildTree(const char* config,
bool for_xcode = false);