make cmaek build scripts more robust

This commit is contained in:
Martin Rotter 2022-03-21 11:13:43 +01:00
parent 12ac417e44
commit 4be036da36
4 changed files with 280 additions and 251 deletions

View file

@ -106,7 +106,7 @@ add_custom_target(AuxFiles SOURCES "resources/scripts/uncrustify/uncrustify.cfg"
# Global compilation switches. # Global compilation switches.
option(BUILD_WITH_QT6 "Build application with Qt 6" OFF) option(BUILD_WITH_QT6 "Build application with Qt 6" OFF)
option(USE_WEBENGINE "Use QtWebEngine for embedded web browser" ON) option(USE_WEBENGINE "Use QtWebEngine for embedded web browser" ON)
option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source" OFF) option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source (Qt 6 only)" OFF)
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)" OFF) option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)" OFF)
option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON) option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON)
@ -229,6 +229,6 @@ elseif(APPLE)
endif() endif()
# Generate localizations, build library and application. # Generate localizations, build library and application.
add_subdirectory(localization)
add_subdirectory(src/librssguard) add_subdirectory(src/librssguard)
add_subdirectory(localization)
add_subdirectory(src/rssguard) add_subdirectory(src/rssguard)

View file

@ -1,4 +1,4 @@
if(UPDATE_TRANSLATIONS) if(UPDATE_TRANSLATIONS AND BUILD_WITH_QT6)
# Regenerate "en" .ts file. # Regenerate "en" .ts file.
# #
# "en" .ts file is only used as "source" language # "en" .ts file is only used as "source" language
@ -20,9 +20,18 @@ FILE(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.ts)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}")
if(BUILD_WITH_QT6)
qt_add_lrelease(rssguard
TS_FILES ${TS_FILES}
QM_FILES_OUTPUT_VARIABLE QM_FILES
OPTIONS "-compress"
)
else()
qt_add_translation(QM_FILES qt_add_translation(QM_FILES
${TS_FILES} ${TS_FILES}
OPTIONS "-compress" OPTIONS "-compress"
) )
add_custom_target(update_qm DEPENDS ${QM_FILES}) add_custom_target(rssguard_lrelease DEPENDS ${QM_FILES})
add_dependencies(rssguard rssguard_lrelease)
endif()

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@
<url type="donation">https://github.com/sponsors/martinrotter</url> <url type="donation">https://github.com/sponsors/martinrotter</url>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="4.2.0" date="2022-03-18"/> <release version="4.2.0" date="2022-03-21"/>
</releases> </releases>
<content_rating type="oars-1.0"> <content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute> <content_attribute id="violence-cartoon">none</content_attribute>