From 3792d8d560352c7e5885038cc650670d52f179cc Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 1 Dec 2021 00:15:56 +0100 Subject: [PATCH] Tweak default UI It's desktop unless you're building for Android where the default it's mobile. You can still manually specify which UI you want and you'll get that regardless of the platform Only require KParts if we're building the desktop UI Two small changes in CI: * Stop pretending we have a macOS CI * Add Android CI - libkexiv2, khtml and kjs would be nice but we don't have Android builds yet --- .gitlab-ci.yml | 1 + .kde-ci.yml | 12 ++++++++---- CMakeLists.txt | 15 +++++++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c18f69da..ef898479a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ variables: DEBIAN_FRONTEND: "noninteractive" include: + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml diff --git a/.kde-ci.yml b/.kde-ci.yml index 275f6e8ae..a3257be92 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -9,13 +9,17 @@ Dependencies: 'frameworks/ki18n': '@stable' 'frameworks/kio': '@stable' 'frameworks/karchive': '@stable' - 'frameworks/khtml': '@stable' - 'frameworks/kjs': '@stable' 'libraries/phonon': '@stable' - 'graphics/libkexiv2': '@same' 'graphics/kdegraphics-mobipocket': '@same' -- 'on': ['Linux', 'FreeBSD', 'macOS'] +- 'on': ['Linux', 'FreeBSD'] 'require': 'frameworks/kactivities': '@stable' + 'frameworks/khtml': '@stable' + 'frameworks/kjs': '@stable' 'frameworks/kpty': '@stable' + 'graphics/libkexiv2': '@same' + +- 'on': ['Android'] + 'require': + 'frameworks/kirigami': '@stable' diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e7ed0cda..990be62fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,15 @@ project(okular VERSION ${RELEASE_SERVICE_VERSION}) set(QT_REQUIRED_VERSION "5.12.0") # Remember to update the QT_DEPRECATED_WARNINGS_SINCE below set(KF5_REQUIRED_VERSION "5.68.0") # Remember to update the KF_DEPRECATED_WARNINGS_SINCE below -set(OKULAR_UI "desktop" CACHE STRING "Which Okular user interface to build. Possible values: desktop, mobile, both. Default: desktop") +set(OKULAR_UI "" CACHE STRING "Which Okular user interface to build. Possible values: desktop, mobile, both. Default: desktop (except on Android, where it is 'mobile')") + +if(OKULAR_UI STREQUAL "") + if(ANDROID) + set(OKULAR_UI "mobile") + else() + set(OKULAR_UI "desktop") + endif() +endif() if(OKULAR_UI STREQUAL "desktop" OR OKULAR_UI STREQUAL "both") set(BUILD_DESKTOP ON) @@ -94,7 +102,6 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS I18n IconThemes KIO - Parts TextWidgets ThreadWeaver WindowSystem @@ -104,6 +111,10 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Wallet ) +if (BUILD_DESKTOP) + find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts) +endif() + if(KF5Wallet_FOUND) add_definitions(-DWITH_KWALLET=1) endif()