diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2021-08-01 16:27:49 (GMT) |
---|---|---|
committer | Johnny Jazeix <jazeix@gmail.com> | 2021-08-01 16:28:47 (GMT) |
commit | 795e406e3bbd99024652f44fc121f36cd291c269 (patch) | |
tree | 877f7d994675b0c5858f36117e5c9666ef2ee55e /Tests/CPackNSISGenerator | |
parent | 0a6415ea1fa286346f119809323938a7cfca8565 (diff) | |
download | CMake-795e406e3bbd99024652f44fc121f36cd291c269.zip CMake-795e406e3bbd99024652f44fc121f36cd291c269.tar.gz CMake-795e406e3bbd99024652f44fc121f36cd291c269.tar.bz2 |
CPack/NSIS: Add option to not display license page
Fixes: #22215
Diffstat (limited to 'Tests/CPackNSISGenerator')
-rw-r--r-- | Tests/CPackNSISGenerator/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Tests/CPackNSISGenerator/CMakeLists.txt b/Tests/CPackNSISGenerator/CMakeLists.txt index 64a8ef6..5d6320b 100644 --- a/Tests/CPackNSISGenerator/CMakeLists.txt +++ b/Tests/CPackNSISGenerator/CMakeLists.txt @@ -19,5 +19,6 @@ set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set(CPACK_NSIS_MANIFEST_DPI_AWARE ON) set(CPACK_NSIS_BRANDING_TEXT "CMake branding text") set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION "RIGHT") +set(CPACK_NSIS_IGNORE_LICENSE_PAGE ON) include(CPack) diff --git a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake index 8bfcf26..31a2560 100644 --- a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake +++ b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake @@ -60,3 +60,12 @@ if("${output_index}" EQUAL "-1") else() message(STATUS "Found BrandingText") endif() + +# license page should not be present +file(STRINGS "${project_file}" line REGEX "!insertmacro MUI_PAGE_LICENSE") +string(FIND "${line}" "MUI_PAGE_LICENSE" output_index) +if("${output_index}" EQUAL "-1") + message(STATUS "License not found in the project") +else() + message(FATAL_ERROR "License found in the project") +endif() |