BUG: Fix for generated install scripts to support prefixes with trailing slashes or just a single slash.

This commit is contained in:
Brad King 2006-03-05 09:09:12 -05:00
parent a2bfdf9542
commit 2b7e43961c
1 changed files with 4 additions and 3 deletions

View File

@ -307,10 +307,11 @@ void cmLocalGenerator::GenerateInstallRules()
// Write the header.
fout << "# Install script for directory: "
<< m_Makefile->GetCurrentDirectory() << std::endl << std::endl;
fout << "# Set the install prefix" << std::endl
<< "IF(NOT CMAKE_INSTALL_PREFIX)" << std::endl
fout << "# Set the install prefix and remove any trailing slash." << std::endl
<< "IF(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl
<< " SET(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl
<< "ENDIF(NOT CMAKE_INSTALL_PREFIX)" << std::endl
<< "ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl
<< "STRING(REGEX REPLACE \"/$\" \"\" CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")" << std::endl
<< std::endl;
// Write support code for generating per-configuration install rules.