Skip to content

Commit

Permalink
build: Add option to clean trs files
Browse files Browse the repository at this point in the history
  • Loading branch information
sithlord48 committed Jun 9, 2024
1 parent af3b5b0 commit 71bb3ac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions translations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)

option(CLEAN_TRS "Clean Obsolete translations from tr files" FALSE)
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS
Core
LinguistTools
Expand Down Expand Up @@ -33,7 +33,13 @@ if(WIN32 OR APPLE)
)
endif()

qt_create_translation(TRS ${CMAKE_SOURCE_DIR} ${blackchocobo_TRS} OPTIONS -no-ui-lines -locations none)
if(CLEAN_TRS)
set(CLEAN_OPTION "-noobsolete")
else()
set(CLEAN_OPTION "")
endif()

qt_create_translation(TRS ${CMAKE_SOURCE_DIR} ${blackchocobo_TRS} OPTIONS -no-ui-lines -locations none ${CLEAN_OPTION})
add_custom_target(app_translations ALL DEPENDS ${TRS})

if(UNIX AND NOT APPLE)
Expand Down

0 comments on commit 71bb3ac

Please sign in to comment.