summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2008-10-15 13:35:27 (GMT)
committerDavid Cole <david.cole@kitware.com>2008-10-15 13:35:27 (GMT)
commitcc51ddd34be500cac386258909c7097f49be438c (patch)
tree867c5b4567c330662713134950596c2db78f35b7 /Source/CPack
parentcbbf0b8183b63f6bffbeeae0bef4476eb80aca5c (diff)
downloadCMake-cc51ddd34be500cac386258909c7097f49be438c.zip
CMake-cc51ddd34be500cac386258909c7097f49be438c.tar.gz
CMake-cc51ddd34be500cac386258909c7097f49be438c.tar.bz2
BUG: Use the DESTDIR prefix when creating the directory in CPack when CPACK_SET_DESTDIR is ON. Thanks to Petri Hodju for reporting this regression to the CMake mailing list: http://www.cmake.org/pipermail/cmake/2008-October/024563.html.
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx32
1 files changed, 24 insertions, 8 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 479db4f..a94736a 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -646,6 +646,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The
// value of the project's CMAKE_INSTALL_PREFIX is sent in here as
// the value of the CPACK_INSTALL_PREFIX variable.
+ //
std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX"))
{
@@ -653,14 +654,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
}
mf->AddDefinition("CMAKE_INSTALL_PREFIX", dir.c_str());
- if ( !cmsys::SystemTools::MakeDirectory(dir.c_str()))
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
- << dir << std::endl);
- return 0;
- }
-
cmCPackLogger(
cmCPackLog::LOG_DEBUG,
"- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
@@ -668,6 +661,29 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
<< std::endl);
+
+ // Make sure that DESTDIR + CPACK_INSTALL_PREFIX directory
+ // exists:
+ //
+ if (cmSystemTools::StringStartsWith(dir.c_str(), "/"))
+ {
+ dir = tempInstallDirectory + dir;
+ }
+ else
+ {
+ dir = tempInstallDirectory + "/" + dir;
+ }
+
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "- Creating directory: '" << dir << "'" << std::endl);
+
+ if ( !cmsys::SystemTools::MakeDirectory(dir.c_str()))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Problem creating temporary directory: "
+ << dir << std::endl);
+ return 0;
+ }
}
else
{