add option to forcibly bundle icon themes, enable for appimage build

This commit is contained in:
Martin Rotter 2022-07-20 13:06:31 +02:00
parent 831029d9a5
commit 37ba269311
5 changed files with 22 additions and 5 deletions

View File

@ -22,6 +22,7 @@
# BUILD_WITH_QT6 - Build either with Qt 6 or Qt 5. # BUILD_WITH_QT6 - Build either with Qt 6 or Qt 5.
# NO_UPDATE_CHECK - Disable automatic checking for new application updates. # NO_UPDATE_CHECK - Disable automatic checking for new application updates.
# IS_FLATPAK_BUILD - Set to "ON" when building RSS Guard with Flatpak. # IS_FLATPAK_BUILD - Set to "ON" when building RSS Guard with Flatpak.
# FORCE_BUNDLE_ICONS - Forcibly bundles icons into executables.
# USE_WEBENGINE - if specified, then QtWebEngine module for internal web browser is used. # USE_WEBENGINE - if specified, then QtWebEngine module for internal web browser is used.
# Otherwise simple text component is used and some features will be disabled. # Otherwise simple text component is used and some features will be disabled.
# Default value is "false". If QtWebEngine is installed during compilation, then # Default value is "false". If QtWebEngine is installed during compilation, then
@ -110,6 +111,7 @@ option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)
option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON) option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON)
option(NO_UPDATE_CHECK "Disable automatic checking for new application updates" OFF) option(NO_UPDATE_CHECK "Disable automatic checking for new application updates" OFF)
option(IS_FLATPAK_BUILD "Set to 'ON' when building RSS Guard with Flatpak." OFF) option(IS_FLATPAK_BUILD "Set to 'ON' when building RSS Guard with Flatpak." OFF)
option(FORCE_BUNDLE_ICONS "Forcibly bundle icon themes into RSS Guard." OFF)
# Import Qt libraries. # Import Qt libraries.
set(QT6_MIN_VERSION 6.3.0) set(QT6_MIN_VERSION 6.3.0)

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.3" date="2022-07-13"/> <release version="4.2.3" date="2022-07-20"/>
</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>

View File

@ -54,7 +54,7 @@ git_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
git_revision=$(git rev-parse --short HEAD) git_revision=$(git rev-parse --short HEAD)
mkdir rssguard-build && cd rssguard-build mkdir rssguard-build && cd rssguard-build
cmake .. -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE="MinSizeRel" -DCMAKE_INSTALL_PREFIX="$prefix" -DREVISION_FROM_GIT="ON" -DBUILD_WITH_QT6="$BUILD_WITH_QT6" -DUSE_WEBENGINE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET" -DINOREADER_CLIENT_ID="$INOREADER_CLIENT_ID" -DINOREADER_CLIENT_SECRET="$INOREADER_CLIENT_SECRET" cmake .. -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DFORCE_BUNDLE_ICONS="ON" -DCMAKE_BUILD_TYPE="MinSizeRel" -DCMAKE_INSTALL_PREFIX="$prefix" -DREVISION_FROM_GIT="ON" -DBUILD_WITH_QT6="$BUILD_WITH_QT6" -DUSE_WEBENGINE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET" -DINOREADER_CLIENT_ID="$INOREADER_CLIENT_ID" -DINOREADER_CLIENT_SECRET="$INOREADER_CLIENT_SECRET"
cmake --build . cmake --build .
cmake --install . --prefix "$prefix" cmake --install . --prefix "$prefix"

View File

@ -517,8 +517,7 @@ set(GMAIL_CLIENT_SECRET "" CACHE STRING "GMail client secret")
set(INOREADER_CLIENT_ID "" CACHE STRING "Inoreader client ID") set(INOREADER_CLIENT_ID "" CACHE STRING "Inoreader client ID")
set(INOREADER_CLIENT_SECRET "" CACHE STRING "Inoreader client secret") set(INOREADER_CLIENT_SECRET "" CACHE STRING "Inoreader client secret")
# Bundle icons on some platforms which do not provide system-wide icon themes. if(APPLE OR WIN32 OR OS2 OR FORCE_BUNDLE_ICONS)
if(APPLE OR WIN32 OR OS2)
qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/icons.qrc) qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/icons.qrc)
endif() endif()
@ -530,6 +529,17 @@ endif()
add_library(rssguard SHARED ${SOURCES} ${QM_FILES}) add_library(rssguard SHARED ${SOURCES} ${QM_FILES})
# Bundle icons on some platforms which do not provide system-wide icon themes.
if(FORCE_BUNDLE_ICONS)
target_compile_definitions(rssguard
PRIVATE
FORCE_BUNDLE_ICONS
)
message(STATUS "Forcibly bundling icon themes.")
endif()
# Add OAuth services definitions. # Add OAuth services definitions.
if(NOT FEEDLY_CLIENT_ID STREQUAL "" AND NOT FEEDLY_CLIENT_SECRET STREQUAL "") if(NOT FEEDLY_CLIENT_ID STREQUAL "" AND NOT FEEDLY_CLIENT_SECRET STREQUAL "")
target_compile_definitions(rssguard target_compile_definitions(rssguard

View File

@ -217,9 +217,14 @@
#define APP_SKIN_METADATA_FILE "metadata.xml" #define APP_SKIN_METADATA_FILE "metadata.xml"
#define APP_STYLE_DEFAULT "Fusion" #define APP_STYLE_DEFAULT "Fusion"
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) #if defined(FORCE_BUNDLE_ICONS)
// Forcibly bundle icons.
#define APP_THEME_DEFAULT "Breeze"
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
// DO NOT icons on Linux.
#define APP_THEME_DEFAULT "" #define APP_THEME_DEFAULT ""
#else #else
// Bundle icons otherwise.
#define APP_THEME_DEFAULT "Breeze" #define APP_THEME_DEFAULT "Breeze"
#endif #endif