summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-07-16 16:19:10 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2019-07-21 23:01:44 (GMT)
commit5f96601675b7b4c1b8d609f31ce39ce35a96a1a5 (patch)
tree47aef0fa10e453781f79f134e4ea0cc7c40a936c /Source/CPack
parentf374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (diff)
downloadCMake-5f96601675b7b4c1b8d609f31ce39ce35a96a1a5.zip
CMake-5f96601675b7b4c1b8d609f31ce39ce35a96a1a5.tar.gz
CMake-5f96601675b7b4c1b8d609f31ce39ce35a96a1a5.tar.bz2
CPack: Introduce CPACK_INSTALL_SCRIPTS variable
The singular name `CPACK_INSTALL_SCRIPT` has existed but was not linked from the CPack documentation. Also, it supported multiple values and should have had a plural name. Add a plural-named alternative now. If both `CPACK_INSTALL_SCRIPTS` and `CPACK_INSTALL_SCRIPT` are set then ignore the latter with a warning. Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 7e07ff4..540ce46 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -235,7 +235,7 @@ int cmCPackGenerator::InstallProject()
return 0;
}
- // If the CPackConfig file sets CPACK_INSTALL_SCRIPT then run them
+ // If the CPackConfig file sets CPACK_INSTALL_SCRIPT(S) then run them
// as listed
if (!this->InstallProjectViaInstallScript(setDestDir,
tempInstallDirectory)) {
@@ -448,7 +448,19 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
int cmCPackGenerator::InstallProjectViaInstallScript(
bool setDestDir, const std::string& tempInstallDirectory)
{
- const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPT");
+ const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
+ {
+ const char* const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT");
+ if (cmakeScript && cmakeScripts) {
+ cmCPackLogger(
+ cmCPackLog::LOG_WARNING,
+ "Both CPACK_INSTALL_SCRIPTS and CPACK_INSTALL_SCRIPT are set, "
+ "the latter will be ignored."
+ << std::endl);
+ } else if (cmakeScript && !cmakeScripts) {
+ cmakeScripts = cmakeScript;
+ }
+ }
if (cmakeScripts && *cmakeScripts) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);