File: DistCommon.cmake

package info (click to toggle)
gnucash-docs 5.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164,276 kB
  • sloc: xml: 101,090; ruby: 229; makefile: 59; sh: 8
file content (26 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (2)
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
function(add_to_dist)
    set(local_dist_files ${dist_files})
    foreach(file ${ARGN})
        if (IS_ABSOLUTE ${file})
            set(fullpath ${file})
        else()
            set(fullpath ${CMAKE_CURRENT_SOURCE_DIR}/${file})
        endif()
        file(RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${fullpath})
        list(APPEND local_dist_files ${relative})
    endforeach()
    set (dist_files ${local_dist_files}
        CACHE INTERNAL "Files that will be included in the distribution tarball")
endfunction()

function(execute_process_and_check_result)
    cmake_parse_arguments(VARS "" "WORKING_DIRECTORY;ERROR_MSG" "COMMAND" ${ARGN})
    execute_process(
            COMMAND ${VARS_COMMAND}
            WORKING_DIRECTORY ${VARS_WORKING_DIRECTORY}
            RESULT_VARIABLE RESULT
    )
    if (NOT "${RESULT}" STREQUAL "0")
        message(FATAL_ERROR ${VARS_ERROR_MSG})
    endif()
endfunction()