2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-26 00:24:52 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
2019-08-02 10:57:12 +02:00
|
|
|
find_package( Qt5 COMPONENTS Core Gui Widgets REQUIRED )
|
2019-08-06 14:33:57 +02:00
|
|
|
set( _extra_libraries "" )
|
2019-08-19 12:55:36 +02:00
|
|
|
set( _extra_src "" )
|
2019-08-06 14:33:57 +02:00
|
|
|
|
|
|
|
### OPTIONAL AppData XML support in PackageModel
|
|
|
|
#
|
|
|
|
#
|
2020-06-16 13:54:13 +02:00
|
|
|
# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares)
|
2019-08-20 13:56:23 +02:00
|
|
|
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
|
|
|
|
if ( WITH_APPDATA )
|
|
|
|
find_package(Qt5 COMPONENTS Xml)
|
|
|
|
if ( Qt5Xml_FOUND )
|
2021-04-24 17:40:37 +02:00
|
|
|
add_definitions( -DHAVE_APPDATA )
|
2019-08-20 13:56:23 +02:00
|
|
|
list( APPEND _extra_libraries Qt5::Xml )
|
|
|
|
list( APPEND _extra_src ItemAppData.cpp )
|
|
|
|
endif()
|
2019-08-06 14:33:57 +02:00
|
|
|
endif()
|
2019-08-19 12:45:05 +02:00
|
|
|
|
2019-08-20 13:56:23 +02:00
|
|
|
### OPTIONAL AppStream support in PackageModel
|
|
|
|
#
|
|
|
|
#
|
|
|
|
option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON )
|
|
|
|
if ( WITH_APPSTREAM )
|
|
|
|
find_package(AppStreamQt)
|
|
|
|
set_package_properties(
|
|
|
|
AppStreamQt PROPERTIES
|
|
|
|
DESCRIPTION "Support for AppStream (cache) data"
|
|
|
|
URL "https://github.com/ximion/appstream"
|
|
|
|
PURPOSE "AppStream provides package data"
|
|
|
|
TYPE OPTIONAL
|
|
|
|
)
|
|
|
|
if ( AppStreamQt_FOUND )
|
|
|
|
add_definitions( -DHAVE_APPSTREAM )
|
|
|
|
list( APPEND _extra_libraries AppStreamQt )
|
|
|
|
list( APPEND _extra_src ItemAppStream.cpp )
|
|
|
|
endif()
|
2019-08-19 12:45:05 +02:00
|
|
|
endif()
|
2019-08-02 10:57:12 +02:00
|
|
|
|
|
|
|
calamares_add_plugin( packagechooser
|
|
|
|
TYPE viewmodule
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
2021-04-13 13:39:47 +02:00
|
|
|
Config.cpp
|
2019-08-02 10:57:12 +02:00
|
|
|
PackageChooserPage.cpp
|
|
|
|
PackageChooserViewStep.cpp
|
2019-08-02 13:05:46 +02:00
|
|
|
PackageModel.cpp
|
2019-08-19 12:55:36 +02:00
|
|
|
${_extra_src}
|
2019-08-02 17:02:02 +02:00
|
|
|
RESOURCES
|
|
|
|
packagechooser.qrc
|
2019-08-02 10:57:12 +02:00
|
|
|
UI
|
|
|
|
page_package.ui
|
|
|
|
LINK_PRIVATE_LIBRARIES
|
2019-08-06 14:33:57 +02:00
|
|
|
${_extra_libraries}
|
2019-08-02 10:57:12 +02:00
|
|
|
SHARED_LIB
|
|
|
|
)
|
|
|
|
|
2020-02-17 14:36:52 +01:00
|
|
|
calamares_add_test(
|
|
|
|
packagechoosertest
|
|
|
|
GUI
|
|
|
|
SOURCES
|
|
|
|
Tests.cpp
|
|
|
|
LIBRARIES
|
|
|
|
calamares_viewmodule_packagechooser
|
|
|
|
${_extra_libraries}
|
|
|
|
)
|