summaryrefslogtreecommitdiff
path: root/res/Fontpack.cmake
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-31 05:43:38 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-31 05:43:38 +0200
commit16c308157ebb54cf4fc3e0897c7419eb12849b7a (patch)
tree0766eb41280c9f25d4d65bef36b3c1d9e688867b /res/Fontpack.cmake
parent1374567d350209d0286b69aecc048ba102fa9db9 (diff)
CMake: `zip` is required for the build
Print error message if `zip` is not found. It is used for creating fontpacks.
Diffstat (limited to 'res/Fontpack.cmake')
-rw-r--r--res/Fontpack.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/res/Fontpack.cmake b/res/Fontpack.cmake
index 9471c93d..26d6df1e 100644
--- a/res/Fontpack.cmake
+++ b/res/Fontpack.cmake
@@ -1,15 +1,18 @@
1find_program (ZIP_EXECUTABLE zip DOC "ZIP archiver") 1find_program (ZIP_EXECUTABLE zip DOC "ZIP archiver")
2if (NOT ZIP_EXECUTABLE)
3 message (FATAL_ERROR "Please install 'zip' to create fontpacks.")
4endif ()
2 5
3function (make_fontpack src) 6function (make_fontpack src)
4 get_filename_component (dst ${src} NAME) 7 get_filename_component (dst ${src} NAME)
5 set (fn ${CMAKE_BINARY_DIR}/${dst}) 8 set (fn ${CMAKE_BINARY_DIR}/${dst})
6 execute_process (COMMAND ${CMAKE_COMMAND} -E remove ${fn}) 9 execute_process (COMMAND ${CMAKE_COMMAND} -E remove ${fn})
7 file (GLOB files RELATIVE ${CMAKE_SOURCE_DIR}/${src} 10 file (GLOB files RELATIVE ${CMAKE_SOURCE_DIR}/${src}
8 ${CMAKE_SOURCE_DIR}/${src}/* 11 ${CMAKE_SOURCE_DIR}/${src}/*
9 ) 12 )
10 message (STATUS " ${src}") 13 message (STATUS " ${src}")
11 execute_process ( 14 execute_process (
12 COMMAND ${ZIP_EXECUTABLE} -0 ${fn} ${files} 15 COMMAND ${ZIP_EXECUTABLE} -0 ${fn} ${files}
13 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${src} 16 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${src}
14 OUTPUT_QUIET 17 OUTPUT_QUIET
15 ) 18 )