diff --git a/CMakeLists.txt b/CMakeLists.txt index 75103c86..ed530348 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,68 +1,73 @@ project(discover) set(PROJECT_VERSION "5.11.90") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12) find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_SOURCE_DIR}/cmake") find_package(Qt5 5.7.0 REQUIRED CONFIG COMPONENTS Widgets Test Network Xml Concurrent DBus Quick) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMMarkAsTest) include(ECMAddTests) include(GenerateExportHeader) find_package(PkgConfig REQUIRED) find_package(KF5 5.34 REQUIRED CoreAddons Config Crash DBusAddons I18n Archive Declarative XmlGui ItemModels KIO) find_package(KF5Kirigami2 2.1.0) find_package(packagekitqt5) find_package(AppStreamQt 0.11.1) find_package(KF5Attica 5.23) find_package(KF5NewStuff 5.23) pkg_check_modules(FLATPAK flatpak>=0.6.12) configure_file(DiscoverVersion.h.in DiscoverVersion.h) add_subdirectory(libdiscover) add_subdirectory(discover) add_subdirectory(exporter) option(WITH_NOTIFIER "Build and install the notifier plasmoid" ON) if(WITH_NOTIFIER) find_package(KF5 REQUIRED Notifications KIO) add_subdirectory(notifier) endif() set_package_properties(KF5Attica PROPERTIES DESCRIPTION "KDE Framework that implements the Open Collaboration Services API" PURPOSE "Required to build the KNewStuff3 backend" TYPE OPTIONAL) set_package_properties(KF5Kirigami2 PROPERTIES DESCRIPTION "KDE's lightweight user interface framework for mobile and convergent applications" URL "https://techbase.kde.org/Kirigami" PURPOSE "Required by discover qml components" TYPE RUNTIME) set_package_properties(KF5NewStuff PROPERTIES DESCRIPTION "Qt library that allows to interact with KNewStuff implementations" PURPOSE "Required to build the KNS backend" TYPE OPTIONAL) set_package_properties(packagekitqt5 PROPERTIES DESCRIPTION "Library that exposes PackageKit resources" URL "http://www.packagekit.org" PURPOSE "Required to build the PackageKit backend" TYPE OPTIONAL) set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Library that lists Appstream resources" URL "http://www.freedesktop.org" PURPOSE "Required to build the PackageKit backend" TYPE OPTIONAL) +set_package_properties(FLATPAK PROPERTIES + DESCRIPTION "Library that exposes flatpak repositories" + URL "http://www.freedesktop.org" + PURPOSE "Required to build the Flatpak backend" + TYPE OPTIONAL) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/libdiscover/backends/CMakeLists.txt b/libdiscover/backends/CMakeLists.txt index 73a5c685..f959ef98 100644 --- a/libdiscover/backends/CMakeLists.txt +++ b/libdiscover/backends/CMakeLists.txt @@ -1,39 +1,41 @@ function(add_unit_test name) add_executable(${name} ${CMAKE_SOURCE_DIR}/libdiscover/tests/modeltest.cpp ${ARGN}) add_test(${name} ${name}) ecm_mark_as_test(${name}) target_link_libraries(${name} Discover::Common Qt5::Test Qt5::Core ${EXTRA_LIBS}) endfunction() if(KF5Attica_FOUND AND KF5NewStuff_FOUND) add_subdirectory(KNSBackend) endif() if(packagekitqt5_FOUND AND AppStreamQt_FOUND) add_subdirectory(PackageKitBackend) endif() option(BUILD_DummyBackend "Build the DummyBackend" "OFF") if(BUILD_DummyBackend) add_subdirectory(DummyBackend) endif() option(BUILD_FlatpakBackend "Build Flatpak support" "ON") if(FLATPAK_FOUND AND AppStreamQt_FOUND AND BUILD_FlatpakBackend) add_subdirectory(FlatpakBackend) +elseif(BUILD_FlatpakBackend) + message(WARNING "BUILD_FlatpakBackend enabled but Flatpak=${FLATPAK_FOUND} or AppStreamQt=${AppStreamQt_FOUND} not found") endif() option(BUILD_SnapBackend "Build Snap support. Still a proof of concept" "OFF") if(BUILD_SnapBackend) find_package(Snapd) set_package_properties(Snapd PROPERTIES DESCRIPTION "Library that exposes Snapd" URL "http://www.snapcraft.io" PURPOSE "Required to build the Snap backend" TYPE OPTIONAL) add_subdirectory(SnapBackend) endif()