2021-08-21 12:11:31 +02:00
|
|
|
find_program(LUPDATE_EXECUTABLE lupdate)
|
|
|
|
find_program(LRELEASE_EXECUTABLE lrelease)
|
|
|
|
|
|
|
|
# Updates all ts files and generates .qm
|
|
|
|
# Absolute paths are needed!
|
2021-08-21 14:35:54 +02:00
|
|
|
# qt_update_translations("${CMAKE_CURRENT_SOURCE_DIR}/qml" "${L10N_LIST}")
|
|
|
|
# The second argument (list) __must__ be passed as string!
|
|
|
|
function(qt_update_translations SOURCE_PATH TS_FILES)
|
2021-08-21 12:11:31 +02:00
|
|
|
|
|
|
|
foreach(_ts_file ${TS_FILES})
|
2021-08-21 14:35:54 +02:00
|
|
|
message(STATUS "Update Translation: ${_ts_file}")
|
2021-08-21 12:11:31 +02:00
|
|
|
execute_process(COMMAND ${LUPDATE_EXECUTABLE} -noobsolete -recursive ${SOURCE_PATH} -ts ${_ts_file} OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND ${LRELEASE_EXECUTABLE} ${_ts_file} OUTPUT_QUIET)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
endfunction()
|