Add verbose option for translation generation in CMake configuration
This commit introduces a new option, TRANSLATIONS_VERBOSE, to the CMakeLists.txt file, allowing users to enable verbose output during the generation of .qm translation files. The qt_add_lrelease command is modified to conditionally include the -silent option based on the value of TRANSLATIONS_VERBOSE, improving the build process for translations.
This commit is contained in:
@@ -1529,10 +1529,15 @@ if(HAVE_DISCORD_RPC)
|
||||
endif()
|
||||
|
||||
if(HAVE_TRANSLATIONS)
|
||||
option(TRANSLATIONS_VERBOSE "Show verbose output while generating .qm translation files" OFF)
|
||||
qt_add_lupdate(strawberry_lib TS_FILES "${CMAKE_SOURCE_DIR}/src/translations/strawberry_en_US.ts" OPTIONS -locations none -no-ui-lines -no-obsolete)
|
||||
file(GLOB_RECURSE ts_files ${CMAKE_SOURCE_DIR}/src/translations/*.ts)
|
||||
set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/data")
|
||||
if(TRANSLATIONS_VERBOSE)
|
||||
qt_add_lrelease(strawberry TS_FILES ${ts_files} QM_FILES_OUTPUT_VARIABLE INSTALL_TRANSLATIONS_FILES)
|
||||
else()
|
||||
qt_add_lrelease(strawberry TS_FILES ${ts_files} QM_FILES_OUTPUT_VARIABLE INSTALL_TRANSLATIONS_FILES OPTIONS -silent)
|
||||
endif()
|
||||
if(NOT INSTALL_TRANSLATIONS)
|
||||
qt_add_resources(strawberry "translations" PREFIX "/i18n" BASE "${CMAKE_CURRENT_BINARY_DIR}/data" FILES "${INSTALL_TRANSLATIONS_FILES}")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user