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.
This commit is contained in:
parent
cbbf0b8183
commit
cc51ddd34b
|
@ -646,6 +646,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
// CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The
|
// CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The
|
||||||
// value of the project's CMAKE_INSTALL_PREFIX is sent in here as
|
// value of the project's CMAKE_INSTALL_PREFIX is sent in here as
|
||||||
// the value of the CPACK_INSTALL_PREFIX variable.
|
// the value of the CPACK_INSTALL_PREFIX variable.
|
||||||
|
//
|
||||||
std::string dir;
|
std::string dir;
|
||||||
if (this->GetOption("CPACK_INSTALL_PREFIX"))
|
if (this->GetOption("CPACK_INSTALL_PREFIX"))
|
||||||
{
|
{
|
||||||
|
@ -653,14 +654,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
}
|
}
|
||||||
mf->AddDefinition("CMAKE_INSTALL_PREFIX", dir.c_str());
|
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(
|
cmCPackLogger(
|
||||||
cmCPackLog::LOG_DEBUG,
|
cmCPackLog::LOG_DEBUG,
|
||||||
"- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
|
"- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
|
||||||
|
@ -668,6 +661,29 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
"- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
|
"- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
|
||||||
<< std::endl);
|
<< 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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue