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