diff options
author | Brad King <brad.king@kitware.com> | 2021-02-09 13:20:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-09 13:20:17 (GMT) |
commit | 18fa819e26c30038e93b0af1f5bbe17d2a776227 (patch) | |
tree | 22dea0fc41d8214fb3a7876fcd1e269d0a5c6679 /Source | |
parent | 54f15cbb9955b1c9e994108391cc44852f5e794e (diff) | |
parent | 0aabeb0c30bae9509f46fdd2d27e8b724b853d6e (diff) | |
download | CMake-18fa819e26c30038e93b0af1f5bbe17d2a776227.zip CMake-18fa819e26c30038e93b0af1f5bbe17d2a776227.tar.gz CMake-18fa819e26c30038e93b0af1f5bbe17d2a776227.tar.bz2 |
Merge topic '21479-branding-name-cpack-nsis'
0aabeb0c30 CPack/NSIS: Add option for setting branding text
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5784
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 435f0ec..263adfd 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -209,6 +209,25 @@ int cmCPackNSISGenerator::PackageFiles() "ManifestDPIAware true"); } + if (this->IsSet("CPACK_NSIS_BRANDING_TEXT")) { + // Default position to LEFT + std::string brandingTextPosition = "LEFT"; + if (this->IsSet("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION")) { + std::string wantedPosition = + this->GetOption("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION"); + const std::set<std::string> possiblePositions{ "CENTER", "LEFT", + "RIGHT" }; + if (possiblePositions.find(wantedPosition) != possiblePositions.end()) { + brandingTextPosition = wantedPosition; + } + } + std::string brandingTextCode = + cmStrCat("BrandingText /TRIM", brandingTextPosition, " \"", + this->GetOption("CPACK_NSIS_BRANDING_TEXT"), "\"\n"); + this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE", + brandingTextCode.c_str()); + } + // Setup all of the component sections if (this->Components.empty()) { this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", ""); |