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.
This commit is contained in:
Brad King 2015-02-11 11:52:19 -05:00
parent 290ca8e2d0
commit ebd556caa9
1 changed files with 3 additions and 2 deletions

View File

@ -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";