mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
CPack: Validate and document NSIS branding text trim positions
This commit is contained in:
@@ -193,3 +193,5 @@ on Windows Nullsoft Scriptable Install System.
|
|||||||
.. versionadded:: 3.20
|
.. versionadded:: 3.20
|
||||||
|
|
||||||
If set, trim down the size of the control to the size of the branding text string.
|
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")) {
|
if (this->IsSet("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION")) {
|
||||||
std::string wantedPosition =
|
std::string wantedPosition =
|
||||||
this->GetOption("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION");
|
this->GetOption("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION");
|
||||||
|
if (!wantedPosition.empty()) {
|
||||||
const std::set<std::string> possiblePositions{ "CENTER", "LEFT",
|
const std::set<std::string> possiblePositions{ "CENTER", "LEFT",
|
||||||
"RIGHT" };
|
"RIGHT" };
|
||||||
if (possiblePositions.find(wantedPosition) != possiblePositions.end()) {
|
if (possiblePositions.find(wantedPosition) ==
|
||||||
|
possiblePositions.end()) {
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Unsupported branding text trim position "
|
||||||
|
<< wantedPosition << std::endl);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
brandingTextPosition = wantedPosition;
|
brandingTextPosition = wantedPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user