summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-11 16:52:19 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-11 20:13:57 (GMT)
commitebd556caa9e1fc92e00c8e401b145c531390e854 (patch)
tree4fc283e98f92c021aad85d7be8a50e274ffddbf4 /Source/cmInstallGenerator.cxx
parent290ca8e2d0328d27f51ff5248c35e32e44fdd1eb (diff)
downloadCMake-ebd556caa9e1fc92e00c8e401b145c531390e854.zip
CMake-ebd556caa9e1fc92e00c8e401b145c531390e854.tar.gz
CMake-ebd556caa9e1fc92e00c8e401b145c531390e854.tar.bz2
cmInstallGenerator: Fix check for absolute install destinations
In AddInstallRule, check for absolute install destinations before converting to the absolute install destination. Previously this worked only by accident because literal "${CMAKE_INSTALL_PREFIX}" looks like a relative path.
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r--Source/cmInstallGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 1d64674..3ae8975 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->ConvertToAbsoluteDestination(this->Destination);
+ std::string const& dest = this->Destination;
if (cmSystemTools::FileIsFullPath(dest.c_str()))
{
os << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n";
@@ -94,7 +94,8 @@ void cmInstallGenerator
<< "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
os << indent << "endif()\n";
}
- os << "file(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype;
+ std::string absDest = this->ConvertToAbsoluteDestination(dest);
+ os << "file(INSTALL DESTINATION \"" << absDest << "\" TYPE " << stype;
if(optional)
{
os << " OPTIONAL";