diff options
author | Brad King <brad.king@kitware.com> | 2006-03-05 14:09:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-03-05 14:09:12 (GMT) |
commit | 2b7e43961cb2f401ce54ae5327a1e50e736ec773 (patch) | |
tree | c9e0ebf81cc7470ffd370ecb34c2ffcb72daa879 /Source/cmLocalGenerator.cxx | |
parent | a2bfdf9542159dbaec9b295b824dbb3a2285f5ce (diff) | |
download | CMake-2b7e43961cb2f401ce54ae5327a1e50e736ec773.zip CMake-2b7e43961cb2f401ce54ae5327a1e50e736ec773.tar.gz CMake-2b7e43961cb2f401ce54ae5327a1e50e736ec773.tar.bz2 |
BUG: Fix for generated install scripts to support prefixes with trailing slashes or just a single slash.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ba62ebb..032e57d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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. |