2021-07-06 19:30:50 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
|
|
|
if( NOT WITH_QML )
|
|
|
|
calamares_skip_module( "packagechooserq (QML is not supported in this build)" )
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core )
|
|
|
|
|
|
|
|
# Add optional libraries here
|
|
|
|
set( USER_EXTRA_LIB )
|
|
|
|
|
|
|
|
# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
|
|
|
|
set( _packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
|
|
|
|
include_directories( ${_packagechooser} )
|
|
|
|
|
|
|
|
### OPTIONAL AppData XML support in PackageModel
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# TODO:3.3:WITH->BUILD (this doesn't affect the ABI offered by Calamares)
|
|
|
|
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
|
|
|
|
if ( WITH_APPDATA )
|
|
|
|
find_package(Qt5 COMPONENTS Xml)
|
|
|
|
if ( Qt5Xml_FOUND )
|
|
|
|
add_definitions( -DHAVE_APPDATA )
|
|
|
|
list( APPEND _extra_libraries Qt5::Xml )
|
2021-08-31 11:33:05 +02:00
|
|
|
list( APPEND _extra_src ${_packagechooser}/ItemAppData.cpp )
|
2021-07-06 19:30:50 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
### 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 )
|
2021-08-31 11:33:05 +02:00
|
|
|
list( APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp )
|
2021-07-06 19:30:50 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
calamares_add_plugin( packagechooserq
|
|
|
|
TYPE viewmodule
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
|
|
|
PackageChooserQmlViewStep.cpp
|
|
|
|
${_packagechooser}/Config.cpp
|
|
|
|
${_packagechooser}/PackageModel.cpp
|
2021-08-31 11:33:05 +02:00
|
|
|
${_extra_src}
|
2021-07-06 19:30:50 +02:00
|
|
|
RESOURCES
|
|
|
|
packagechooserq.qrc
|
|
|
|
LINK_PRIVATE_LIBRARIES
|
|
|
|
calamaresui
|
|
|
|
${_extra_libraries}
|
|
|
|
SHARED_LIB
|
|
|
|
)
|