Skip to content
Snippets Groups Projects
Commit a6a52563 authored by Craig Scott's avatar Craig Scott
Browse files

CPack: Validate and document NSIS branding text trim positions

parent b7b0fb43
No related branches found
No related tags found
No related merge requests found
......@@ -193,3 +193,5 @@ 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``.
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment