[packagechooser] Add CMake knobs to enable/disable item choices

- AppData and AppStream can be disabled independently of finding
   their requirements (possibly useful if you want to ignore
   AppStream even when it's installed in your build environment).
 - Add a little top-level documentation about WITH_
main
Adriaan de Groot 5 years ago
parent ffa899b497
commit 8c5caf9fd0

@ -25,6 +25,9 @@
# SKIP_MODULES : a space or semicolon-separated list of directory names
# under src/modules that should not be built.
# USE_<foo> : fills in SKIP_MODULES for modules called <foo>-<something>
# WITH_<foo> : try to enable <foo> (these usually default to ON). For
# a list of WITH_<foo> grep CMakeCache.txt after running
# CMake once.
# BUILD_<foo> : choose additional things to build
# DEBUG_<foo> : special developer flags for debugging
#

@ -5,25 +5,34 @@ set( _extra_src "" )
### OPTIONAL AppData XML support in PackageModel
#
#
find_package(Qt5 COMPONENTS Xml)
if ( Qt5Xml_FOUND )
add_definitions( -DHAVE_XML )
list( APPEND _extra_libraries Qt5::Xml )
list( APPEND _extra_src ItemAppData.cpp )
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_XML )
list( APPEND _extra_libraries Qt5::Xml )
list( APPEND _extra_src ItemAppData.cpp )
endif()
endif()
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 )
### 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()
endif()
calamares_add_plugin( packagechooser

Loading…
Cancel
Save