summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-11 16:48:02 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-11 20:12:16 (GMT)
commit290ca8e2d0328d27f51ff5248c35e32e44fdd1eb (patch)
treed87e3cd4a2c7d7d538ed1bc53f769fc69f198d39 /Source/cmInstallGenerator.cxx
parentf99991db882c2f4cf8246b9c272845faaa5bbce5 (diff)
downloadCMake-290ca8e2d0328d27f51ff5248c35e32e44fdd1eb.zip
CMake-290ca8e2d0328d27f51ff5248c35e32e44fdd1eb.tar.gz
CMake-290ca8e2d0328d27f51ff5248c35e32e44fdd1eb.tar.bz2
cmInstallGenerator: Refactor computation of absolute install dest
Replace the GetInstallDestination method, which looked up the Destination ivar, with a new ConvertToAbsoluteDestination method that takes the nominal destination as an argument. Update call sites accordingly. This will allow some clients to transform the install destination before calling the method.
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r--Source/cmInstallGenerator.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index b261cbf..1d64674 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -60,7 +60,7 @@ void cmInstallGenerator
case cmInstallType_FILES: stype = "FILE"; break;
}
os << indent;
- std::string dest = this->GetInstallDestination();
+ std::string dest = this->ConvertToAbsoluteDestination(this->Destination);
if (cmSystemTools::FileIsFullPath(dest.c_str()))
{
os << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n";
@@ -179,15 +179,16 @@ bool cmInstallGenerator::InstallsForConfig(const std::string& config)
}
//----------------------------------------------------------------------------
-std::string cmInstallGenerator::GetInstallDestination() const
+std::string
+cmInstallGenerator::ConvertToAbsoluteDestination(std::string const& dest) const
{
std::string result;
- if(!this->Destination.empty() &&
- !cmSystemTools::FileIsFullPath(this->Destination.c_str()))
+ if(!dest.empty() &&
+ !cmSystemTools::FileIsFullPath(dest.c_str()))
{
result = "${CMAKE_INSTALL_PREFIX}/";
}
- result += this->Destination;
+ result += dest;
return result;
}