diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2021-02-07 15:10:57 (GMT) |
---|---|---|
committer | Johnny Jazeix <jazeix@gmail.com> | 2021-02-07 15:10:57 (GMT) |
commit | 0aabeb0c30bae9509f46fdd2d27e8b724b853d6e (patch) | |
tree | ff5adfea94e480814a9ebf46f8529e2ca9d133f0 /Source/CPack | |
parent | 51f7d7e919bab508d898770f44a1f57e7a748895 (diff) | |
download | CMake-0aabeb0c30bae9509f46fdd2d27e8b724b853d6e.zip CMake-0aabeb0c30bae9509f46fdd2d27e8b724b853d6e.tar.gz CMake-0aabeb0c30bae9509f46fdd2d27e8b724b853d6e.tar.bz2 |
CPack/NSIS: Add option for setting branding text
See https://nsis.sourceforge.io/Reference/BrandingText
for more information.
Fixes: #21479
Diffstat (limited to 'Source/CPack')
-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", ""); |