2
message(FATAL_ERROR "cpack not defined")
6
message(FATAL_ERROR "dir not defined")
9
# Analyze 'cpack --help' output for list of available generators:
11
execute_process(COMMAND ${cpack} --help
12
RESULT_VARIABLE result
13
OUTPUT_VARIABLE stdout
15
WORKING_DIRECTORY ${dir})
17
string(REPLACE ";" "\\;" stdout "${stdout}")
18
string(REPLACE "\n" "E;" stdout "${stdout}")
22
foreach(eline ${stdout})
23
string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}")
24
if(collecting AND NOT line STREQUAL "")
25
string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\1" gen "${line}")
26
string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\2" doc "${line}")
27
set(generators ${generators} ${gen})
29
if(line STREQUAL "Generators")
34
# Call cpack with -G on each available generator. We do not care if this
35
# succeeds or not. We expect it *not* to succeed if the underlying packaging
36
# tools are not installed on the system... This test is here simply to add
37
# coverage for the various cpack generators, even/especially to test ones
38
# where the tools are not installed.
40
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
42
message(STATUS "CPack generators='${generators}'")
44
foreach(g ${generators})
45
message(STATUS "Calling cpack -G ${g}...")
46
execute_process(COMMAND ${cpack} -G ${g}
47
RESULT_VARIABLE result
48
OUTPUT_VARIABLE stdout
50
WORKING_DIRECTORY ${dir})
51
message(STATUS "result='${result}'")
52
message(STATUS "stdout='${stdout}'")
53
message(STATUS "stderr='${stderr}'")