diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2020-01-02 21:27:31 (GMT) |
---|---|---|
committer | Johnny Jazeix <jazeix@gmail.com> | 2020-01-02 21:27:31 (GMT) |
commit | ebfffc609e2bfe974a0f56b64285089e7eac4257 (patch) | |
tree | 60df1dba2632d514eb1ddee1002ef9e22e9385b0 /Source/CPack | |
parent | 77b49149f5fdb9939ffc353996f8b7570e99da4c (diff) | |
download | CMake-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.cxx | 13 |
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()); } |