summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-16 20:19:00 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-16 20:19:00 (GMT)
commit537e2b4ed57d5a84f140f9b9bde427e7b604b330 (patch)
tree8f7869ce7e441cdb2b45d46a235d74ca97cde6f9 /Source/cmMakefileExecutableTargetGenerator.cxx
parent13661cdd23790dd6d8c118ba7b95b278966e7dae (diff)
downloadCMake-537e2b4ed57d5a84f140f9b9bde427e7b604b330.zip
CMake-537e2b4ed57d5a84f140f9b9bde427e7b604b330.tar.gz
CMake-537e2b4ed57d5a84f140f9b9bde427e7b604b330.tar.bz2
ENH: Implemented RPATH specification support. It is documented by the command SET_TARGET_PROPERTIES.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 600cb2e..87d6feb 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -39,7 +39,12 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
this->WriteTargetDependRules();
// write the link rules
- this->WriteExecutableRule();
+ this->WriteExecutableRule(false);
+ if(this->Target->NeedRelinkBeforeInstall())
+ {
+ // Write rules to link an installable version of the target.
+ this->WriteExecutableRule(true);
+ }
// Write the requires target.
this->WriteTargetRequiresRules();
@@ -54,7 +59,7 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
//----------------------------------------------------------------------------
-void cmMakefileExecutableTargetGenerator::WriteExecutableRule()
+void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
{
std::vector<std::string> commands;
@@ -132,6 +137,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule()
false, false, false);
}
#endif
+ if(relink)
+ {
+ outpath = this->Makefile->GetStartOutputDirectory();
+ outpath += "/CMakeFiles/CMakeRelink.dir";
+ cmSystemTools::MakeDirectory(outpath.c_str());
+ outpath += "/";
+ }
std::string targetFullPath = outpath + targetName;
std::string targetFullPathReal = outpath + targetNameReal;
@@ -259,7 +271,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule()
// Collect up flags to link in needed libraries.
cmOStringStream linklibs;
- this->LocalGenerator->OutputLinkLibraries(linklibs, *this->Target);
+ this->LocalGenerator->OutputLinkLibraries(linklibs, *this->Target, relink);
// Construct object file lists that may be needed to expand the
// rule.
@@ -316,7 +328,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule()
dir += "/";
dir += this->LocalGenerator->GetTargetDirectory(*this->Target);
std::string buildTargetRuleName = dir;
- buildTargetRuleName += "/build";
+ buildTargetRuleName += relink?"/preinstall":"/build";
buildTargetRuleName =
this->Convert(buildTargetRuleName.c_str(),
cmLocalGenerator::HOME_OUTPUT,