From 98f5ab5aa00f4d6b83079e6ee4e228b401356198 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 31 Oct 2021 12:23:26 +0200 Subject: Changed format of resources.lgr Resources are now stored in a ZIP archive, and it comes with an explicit version number. All the old embed/bincat stuff was removed as unnecessary. resources.lgr is also a valid fontpack, for loading the built-in fonts. IssueID #363 --- Resources.cmake | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Resources.cmake (limited to 'Resources.cmake') diff --git a/Resources.cmake b/Resources.cmake new file mode 100644 index 00000000..fc5d20c6 --- /dev/null +++ b/Resources.cmake @@ -0,0 +1,27 @@ +find_program (ZIP_EXECUTABLE zip DOC "ZIP archiver") +if (NOT ZIP_EXECUTABLE) + message (FATAL_ERROR "Please install 'zip' for packaging resources.") +endif () + +function (make_resources dst) + list (REMOVE_AT ARGV 0) + set (files) + foreach (arg ${ARGV}) + get_filename_component (name ${arg} NAME) + if (NOT "${name}" MATCHES "^\\..*") + string (SUBSTRING ${arg} 4 -1 rel) + list (APPEND files ${rel}) + endif () + endforeach (arg) + file (REMOVE ${dst}) + get_filename_component (dstName ${dst} NAME) + message (STATUS " ${dstName}") + set (versionTempPath ${CMAKE_SOURCE_DIR}/res/VERSION) + file (WRITE ${versionTempPath} ${PROJECT_VERSION}) + execute_process ( + COMMAND ${ZIP_EXECUTABLE} -1 ${dst} VERSION ${files} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res + OUTPUT_QUIET + ) + file (REMOVE ${versionTempPath}) +endfunction () -- cgit v1.2.3