summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:11:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:11:20 (GMT)
commitea7c7bb34dc55fc830e58102181e47c2f1488d83 (patch)
tree33cf71d574b848070b9f7b51f042a39bdb1500a9 /Source
parent5e56c7c201a60a8a63b4a5c3ba8c622bcf1a55ab (diff)
downloadCMake-ea7c7bb34dc55fc830e58102181e47c2f1488d83.zip
CMake-ea7c7bb34dc55fc830e58102181e47c2f1488d83.tar.gz
CMake-ea7c7bb34dc55fc830e58102181e47c2f1488d83.tar.bz2
ENH: Allow the installer to overwrite the install prefix
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f48f760..60ca2ed 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -287,6 +287,11 @@ void cmLocalGenerator::GenerateInstallRules()
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
+ << " SET(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl
+ << "ENDIF(NOT CMAKE_INSTALL_PREFIX)" << std::endl
+ << std::endl;
const char* cmakeDebugPosfix = m_Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
if ( cmakeDebugPosfix )
@@ -344,7 +349,7 @@ void cmLocalGenerator::GenerateInstallRules()
}
if (l->second.GetInstallPath() != "")
{
- destination = prefix + l->second.GetInstallPath();
+ destination = "${CMAKE_INSTALL_PREFIX}/" + l->second.GetInstallPath();
cmSystemTools::ConvertToUnixSlashes(destination);
const char* dest = destination.c_str();
int type = l->second.GetType();
@@ -376,7 +381,7 @@ void cmLocalGenerator::GenerateInstallRules()
libname += ".lib";
files = libname.c_str();
this->AddInstallRule(fout, dest, cmTarget::STATIC_LIBRARY, files, true);
- std::string dlldest = prefix + l->second.GetRuntimeInstallPath();
+ std::string dlldest = "${CMAKE_INSTALL_PREFIX}/" + l->second.GetRuntimeInstallPath();
files = fname.c_str();
this->AddInstallRule(fout, dlldest.c_str(), type, files);
}