summaryrefslogtreecommitdiff
path: root/res/Fontpack.cmake
blob: 26d6df1e64f65a6fcf6e8615b569e8f3ec4f4991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
find_program (ZIP_EXECUTABLE zip DOC "ZIP archiver")
if (NOT ZIP_EXECUTABLE)
    message (FATAL_ERROR "Please install 'zip' to create fontpacks.")
endif ()

function (make_fontpack src)
    get_filename_component (dst ${src} NAME)
    set (fn ${CMAKE_BINARY_DIR}/${dst})
    execute_process (COMMAND ${CMAKE_COMMAND} -E remove ${fn})
    file (GLOB files RELATIVE ${CMAKE_SOURCE_DIR}/${src}
        ${CMAKE_SOURCE_DIR}/${src}/*
    )
    message (STATUS "  ${src}")
    execute_process (
        COMMAND ${ZIP_EXECUTABLE} -0 ${fn} ${files}
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${src}
        OUTPUT_QUIET
    )
endfunction ()