summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDocumentVariables.cxx21
-rw-r--r--Source/CPack/cmCPackGenerator.cxx12
2 files changed, 28 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index b529480..edbef45 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -79,18 +79,33 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
"Variables common to all CPack generators");
cm->DefineProperty
+ ("CPACK_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE,
+ "List of files which have been installed using "
+ " an ABSOLUTE DESTINATION path.",
+ "This variable is a Read-Only variable which is set internally"
+ " by CPack during installation and before packaging using"
+ " CMAKE_ABSOLUTE_DESTINATION_FILES defined in cmake_install.cmake "
+ "scripts. The value can be used within CPack project configuration"
+ " file and/or CPack<GEN>.cmake file of <GEN> generator.", false,
+ "Variables common to all CPack generators");
+
+ cm->DefineProperty
("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
"Ask CPack to warn each time a file with absolute INSTALL"
" DESTINATION is encountered.",
- "", false,
+ "This variable triggers the definition of "
+ "CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
+ " cmake_install.cmake scripts.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
"Ask CPack to error out as soon as a file with absolute INSTALL"
- " DESTINATION is encountered",
+ " DESTINATION is encountered.",
"The fatal error is emitted before the installation of "
"the offending file takes place. Some CPack generators, like NSIS,"
- "enforce this internally.", false,
+ "enforce this internally. "
+ "This variable triggers the definition of"
+ "CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
"Variables common to all CPack generators");
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index ca790c0..87a3b9e 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -854,7 +854,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// then forward request to cmake_install.cmake script
if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
- mf->AddDefinition("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
+ mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
}
// If current CPack generator does support
@@ -864,11 +864,19 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if (!SupportsAbsoluteDestination() ||
this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
- mf->AddDefinition("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
+ mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
}
// do installation
int res = mf->ReadListFile(0, installFile.c_str());
+ // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES
+ // to CPack (may be used by generators like CPack RPM or DEB)
+ // in order to transparently handle ABSOLUTE PATH
+ if (mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES"))
+ {
+ mf->AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES",
+ mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES"));
+ }
// Now rebuild the list of files after installation
// of the current component (if we are in component install)