summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-05-26 22:53:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-26 22:53:40 (GMT)
commit445c73d3fadea0dcc0b52f25ead9afbcd926631b (patch)
treed66d20ce91d286f99c825dfa2c84782b42f1c84c /Source/CPack
parentc5657a2fe42a0de7a5724507888f9f6f1afff8ea (diff)
parent26e36111d326bbf69f437ef1335423ea3b2835e2 (diff)
downloadCMake-445c73d3fadea0dcc0b52f25ead9afbcd926631b.zip
CMake-445c73d3fadea0dcc0b52f25ead9afbcd926631b.tar.gz
CMake-445c73d3fadea0dcc0b52f25ead9afbcd926631b.tar.bz2
Merge topic 'cpack-install-opts'
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6141
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index cd2adaa..00e274d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -902,6 +902,23 @@ int cmCPackGenerator::InstallCMakeProject(
this->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")) {
mf.AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1");
}
+
+ std::vector<std::string> custom_variables;
+ this->MakefileMap->GetDefExpandList("CPACK_CUSTOM_INSTALL_VARIABLES",
+ custom_variables);
+
+ for (auto const& custom_variable : custom_variables) {
+ std::string value;
+
+ auto i = custom_variable.find('=');
+
+ if (i != std::string::npos) {
+ value = custom_variable.substr(i + 1);
+ }
+
+ mf.AddDefinition(custom_variable.substr(0, i), value);
+ }
+
// do installation
bool res = mf.ReadListFile(installFile);
// forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES