File: RunCPackVerifyResult.cmake

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (100 lines) | stat: -rw-r--r-- 3,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
message(STATUS "=============================================================")
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
message(STATUS "")

if(NOT CPackNSISGenerator_BINARY_DIR)
  message(FATAL_ERROR "CPackNSISGenerator_BINARY_DIR not set")
endif()

message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}")
message(STATUS "CPackNSISGenerator_BINARY_DIR: ${CPackNSISGenerator_BINARY_DIR}")

if(config)
  set(_C_config -C ${config})
endif()

execute_process(COMMAND "${CMAKE_CPACK_COMMAND}"
                        ${_C_config}
  RESULT_VARIABLE CPack_result
  OUTPUT_VARIABLE CPack_output
  ERROR_VARIABLE CPack_error
  WORKING_DIRECTORY "${CPackNSISGenerator_BINARY_DIR}")

if(CPack_result)
  message(FATAL_ERROR "CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
else ()
  message(STATUS "CPack_output=${CPack_output}")
endif()

set(expected_file_mask "${CPackNSISGenerator_BINARY_DIR}/_CPack_Packages/*/NSIS/*.nsi")
file(GLOB project_file "${expected_file_mask}")

message(STATUS "project_file='${project_file}'")
message(STATUS "expected_file_mask='${expected_file_mask}'")

if(NOT project_file)
  message(FATAL_ERROR "project_file does not exist.")
endif()

# should match !define MUI_HEADERIMAGE_BITMAP "${PROJECT_SOURCE_DIR}\header-image.bmp"
file(STRINGS "${project_file}" line REGEX "^!define MUI_HEADERIMAGE_BITMAP")
string(FIND "${line}" "header-image.bmp" output_index)
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()

file(STRINGS "${project_file}" line REGEX "^BrandingText /TRIMRIGHT \"CMake branding text\"")
string(FIND "${line}" "TRIMRIGHT" output_index)
if("${output_index}" EQUAL "-1")
  message(FATAL_ERROR "BrandingText not found in the project")
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()

file(STRINGS "${project_file}" line REGEX [[\\_CON\\]])
string(FIND "${line}" [[\_CON\]] output_index)
message(STATUS "Found CON component reserved directory name as _CON")
if("${output_index}" EQUAL "-1")
  message(FATAL_ERROR "CON component reserved directory name not found as _CON in the project")
endif()

file(STRINGS "${project_file}" line REGEX [[\\Console\\]])
string(FIND "${line}" [[\Console\]] output_index)
message(STATUS "Found Console component directory name as Console")
if("${output_index}" EQUAL "-1")
  message(FATAL_ERROR "Console component directory name not found as Console in the project")
endif()

file(STRINGS "${project_file}" line REGEX [[\\EndsWithDot._\\]])
string(FIND "${line}" [[\EndsWithDot._\]] output_index)
message(STATUS "Found EndsWithDot. component directory name as EndsWithDot._")
if("${output_index}" EQUAL "-1")
  message(FATAL_ERROR "EndsWithDot. component directory name not found as EndsWithDot._ in the project")
endif()

file(STRINGS "${project_file}" line REGEX "^CRCCheck off")
string(FIND "${line}" "off" output_index)
if("${output_index}" EQUAL "-1")
  message(FATAL_ERROR "CRCCheck off not found in the project")
else()
  message(STATUS "Found CRCCheck")
endif()