Add language compile tool

This commit is contained in:
2025-06-22 19:24:13 -05:00
parent c176078df2
commit 8ab17dae6c
5 changed files with 168 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# Copyright (c) 2025 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
find_package(Python3 COMPONENTS Interpreter REQUIRED)
# Custom command to generate all header files
add_custom_target(DUSK_LANGUAGES
COMMAND
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/languagecompile.py
--output ${DUSK_GENERATED_HEADERS_DIR}/locale/language/
--input ${DUSK_DATA_DIR}/languages/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/languagecompile.py
COMMENT "Generating language header files"
VERBATIM
)
# Ensure headers are generated before compiling main
add_dependencies(${DUSK_TARGET_NAME} DUSK_LANGUAGES)