| 1 |
if(UPDATE_TRANSLATIONS AND BUILD_WITH_QT6) |
| 2 |
# Regenerate "en" .ts file. |
| 3 |
# |
| 4 |
# "en" .ts file is only used as "source" language |
| 5 |
# and it is not offered in RSS Guard as localization. |
| 6 |
file(GLOB_RECURSE ALL_SOURCES |
| 7 |
"${CMAKE_SOURCE_DIR}/src/librssguard*/*.cpp" |
| 8 |
"${CMAKE_SOURCE_DIR}/src/librssguard*/*.h" |
| 9 |
"${CMAKE_SOURCE_DIR}/src/librssguard*/*.ui") |
| 10 |
|
| 11 |
qt_add_lupdate(rssguard |
| 12 |
TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/rssguard_en.ts" |
| 13 |
SOURCES ${ALL_SOURCES} |
| 14 |
INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/src/librssguard" |
| 15 |
OPTIONS "-no-obsolete") |
| 16 |
endif() |
| 17 |
|
| 18 |
# Collect all .ts files and generate .qm files. |
| 19 |
FILE(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.ts) |
| 20 |
|
| 21 |
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") |
| 22 |
|
| 23 |
if(BUILD_WITH_QT6) |
| 24 |
qt_add_lrelease(rssguard |
| 25 |
TS_FILES ${TS_FILES} |
| 26 |
QM_FILES_OUTPUT_VARIABLE QM_FILES |
| 27 |
OPTIONS "-compress" |
| 28 |
) |
| 29 |
else() |
| 30 |
qt_add_translation(QM_FILES |
| 31 |
${TS_FILES} |
| 32 |
OPTIONS "-compress" |
| 33 |
) |
| 34 |
|
| 35 |
add_custom_target(rssguard_lrelease DEPENDS ${QM_FILES}) |
| 36 |
add_dependencies(rssguard rssguard_lrelease) |
| 37 |
endif() |