Merge topic 'cpack-nsis-dpi-aware'

d6840a4f3c CPack/NSIS: Add option for setting DPI-aware

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4607
This commit is contained in:
Brad King
2020-04-15 13:50:30 +00:00
committed by Kitware Robot
6 changed files with 25 additions and 0 deletions
+4
View File
@@ -155,3 +155,7 @@ on Windows Nullsoft Scriptable Install System.
.. variable:: CPACK_NSIS_MUI_HEADERIMAGE
The image to display on the header of installers pages.
.. variable:: CPACK_NSIS_MANIFEST_DPI_AWARE
If set, declares that the installer is DPI-aware.
+6
View File
@@ -0,0 +1,6 @@
nsis-dpi-aware
--------------
* The :cpack_gen:`CPack NSIS Generator` gained a new variable
:variable:`CPACK_NSIS_MANIFEST_DPI_AWARE` to declare that the
installer is DPI-aware.
+1
View File
@@ -41,6 +41,7 @@
RequestExecutionLevel admin
@CPACK_NSIS_DEFINES@
@CPACK_NSIS_MANIFEST_DPI_AWARE_CODE@
!include Sections.nsh
+5
View File
@@ -203,6 +203,11 @@ int cmCPackNSISGenerator::PackageFiles()
"!define MUI_FINISHPAGE_TITLE_3LINES");
}
if (this->IsSet("CPACK_NSIS_MANIFEST_DPI_AWARE")) {
this->SetOptionIfNotSet("CPACK_NSIS_MANIFEST_DPI_AWARE_CODE",
"ManifestDPIAware true");
}
// Setup all of the component sections
if (this->Components.empty()) {
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
+1
View File
@@ -16,5 +16,6 @@ set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}\\\\install.ico")
set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}\\\\uninstall.ico")
set(CPACK_GENERATOR "NSIS")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
include(CPack)
@@ -44,3 +44,11 @@ message(STATUS "Found the bitmap at index ${output_index}")
if("${output_index}" EQUAL "-1")
message(FATAL_ERROR "MUI_HEADERIMAGE_BITMAP not found in the project")
endif()
file(STRINGS "${project_file}" line REGEX "^ManifestDPIAware true")
string(FIND "${line}" "true" output_index)
if("${output_index}" EQUAL "-1")
message(FATAL_ERROR "ManifestDPIAware true not found in the project")
else()
message(STATUS "Found DPI-aware")
endif()