summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorJohnny Jazeix <jazeix@gmail.com>2020-01-02 21:27:31 (GMT)
committerJohnny Jazeix <jazeix@gmail.com>2020-01-02 21:27:31 (GMT)
commitebfffc609e2bfe974a0f56b64285089e7eac4257 (patch)
tree60df1dba2632d514eb1ddee1002ef9e22e9385b0 /Source/CPack
parent77b49149f5fdb9939ffc353996f8b7570e99da4c (diff)
downloadCMake-ebfffc609e2bfe974a0f56b64285089e7eac4257.zip
CMake-ebfffc609e2bfe974a0f56b64285089e7eac4257.tar.gz
CMake-ebfffc609e2bfe974a0f56b64285089e7eac4257.tar.bz2
CPack/NSIS: Add option for setting MUI_HEADERIMAGE_BITMAP
Fixes: #20120
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 4702639..363f536 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -139,10 +139,15 @@ int cmCPackNSISGenerator::PackageFiles()
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
installerIconCode.c_str());
}
- if (this->IsSet("CPACK_PACKAGE_ICON")) {
- std::string installerIconCode =
- cmStrCat("!define MUI_HEADERIMAGE_BITMAP \"",
- this->GetOption("CPACK_PACKAGE_ICON"), "\"\n");
+ std::string installerHeaderImage;
+ if (this->IsSet("CPACK_NSIS_MUI_HEADERIMAGE")) {
+ installerHeaderImage = this->GetOption("CPACK_NSIS_MUI_HEADERIMAGE");
+ } else if (this->IsSet("CPACK_PACKAGE_ICON")) {
+ installerHeaderImage = this->GetOption("CPACK_PACKAGE_ICON");
+ }
+ if (!installerHeaderImage.empty()) {
+ std::string installerIconCode = cmStrCat(
+ "!define MUI_HEADERIMAGE_BITMAP \"", installerHeaderImage, "\"\n");
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_ICON_CODE",
installerIconCode.c_str());
}