diff options
author | Mike McQuaid <mike@mikemcquaid.com> | 2011-01-06 12:35:48 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-01-06 20:14:38 (GMT) |
commit | fec32328b17662d44bfa7769e672529c24e1697f (patch) | |
tree | 9679aaba4afd6dbd7c97e5ba6137bacc6088f80b | |
parent | 8e6ad8ce72d9f00a98b6dc4fbe66037c1f1372de (diff) | |
download | CMake-fec32328b17662d44bfa7769e672529c24e1697f.zip CMake-fec32328b17662d44bfa7769e672529c24e1697f.tar.gz CMake-fec32328b17662d44bfa7769e672529c24e1697f.tar.bz2 |
Allow NSIS package or uninstall icon (#11143)
Previously both CPACK_NSIS_MUI_ICON and CPACK_NSIS_MUI_UNIICON
needed to be set for either to take effect. This commit allows
either to be set rather than requiring both as users may well
want to e.g. use a default uninstall icon but a custom install
icon.
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index f25866c..f3ebf30 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -129,14 +129,21 @@ int cmCPackNSISGenerator::PackageFiles() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName << " to " << nsisFileName << std::endl); if(this->IsSet("CPACK_NSIS_MUI_ICON") - && this->IsSet("CPACK_NSIS_MUI_UNIICON")) + || this->IsSet("CPACK_NSIS_MUI_UNIICON")) { - std::string installerIconCode="!define MUI_ICON \""; - installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON"); - installerIconCode += "\"\n"; - installerIconCode += "!define MUI_UNICON \""; - installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON"); - installerIconCode += "\"\n"; + std::string installerIconCode; + if(this->IsSet("CPACK_NSIS_MUI_ICON")) + { + installerIconCode += "!define MUI_ICON \""; + installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON"); + installerIconCode += "\"\n"; + } + if(this->IsSet("CPACK_NSIS_MUI_UNIICON")) + { + installerIconCode += "!define MUI_UNICON \""; + installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON"); + installerIconCode += "\"\n"; + } this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE", installerIconCode.c_str()); } |