summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-25 14:23:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-03-25 14:23:25 (GMT)
commitfde2347f98029af31f7a0d264eea964bcd86c56b (patch)
treedbdb9c1b312edbd7763103d2dfca08ad89dc938e
parentc0aa4244f5b1900c280b54a5453cc881dc7d3d95 (diff)
parentf226a1678fe27817649ec536ad2923a98a7646a3 (diff)
downloadCMake-fde2347f98029af31f7a0d264eea964bcd86c56b.zip
CMake-fde2347f98029af31f7a0d264eea964bcd86c56b.tar.gz
CMake-fde2347f98029af31f7a0d264eea964bcd86c56b.tar.bz2
Merge topic 'nsis-branding-trim-position'
f226a1678f Merge branch 'master' into nsis-branding-trim-position a6a5256395 CPack: Validate and document NSIS branding text trim positions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5928
-rw-r--r--Help/cpack_gen/nsis.rst2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx13
2 files changed, 12 insertions, 3 deletions
diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst
index 964f629..02e33ba 100644
--- a/Help/cpack_gen/nsis.rst
+++ b/Help/cpack_gen/nsis.rst
@@ -193,6 +193,8 @@ on Windows Nullsoft Scriptable Install System.
.. versionadded:: 3.20
If set, trim down the size of the control to the size of the branding text string.
+ Allowed values for this variable are ``LEFT``, ``CENTER`` or ``RIGHT``.
+ If not specified, the default behavior is ``LEFT``.
.. variable:: CPACK_NSIS_EXECUTABLE
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 9b00704..6bd0d1b 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -215,9 +215,16 @@ int cmCPackNSISGenerator::PackageFiles()
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()) {
+ if (!wantedPosition.empty()) {
+ const std::set<std::string> possiblePositions{ "CENTER", "LEFT",
+ "RIGHT" };
+ if (possiblePositions.find(wantedPosition) ==
+ possiblePositions.end()) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Unsupported branding text trim position "
+ << wantedPosition << std::endl);
+ return false;
+ }
brandingTextPosition = wantedPosition;
}
}