[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_
This commit is contained in:
Adriaan de Groot 2019-08-20 13:56:23 +02:00
parent ffa899b497
commit 8c5caf9fd0
2 changed files with 29 additions and 17 deletions

View File

@ -25,6 +25,9 @@
# SKIP_MODULES : a space or semicolon-separated list of directory names # SKIP_MODULES : a space or semicolon-separated list of directory names
# under src/modules that should not be built. # under src/modules that should not be built.
# USE_<foo> : fills in SKIP_MODULES for modules called <foo>-<something> # 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 # BUILD_<foo> : choose additional things to build
# DEBUG_<foo> : special developer flags for debugging # DEBUG_<foo> : special developer flags for debugging
# #

View File

@ -5,13 +5,21 @@ set( _extra_src "" )
### OPTIONAL AppData XML support in PackageModel ### OPTIONAL AppData XML support in PackageModel
# #
# #
option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
if ( WITH_APPDATA )
find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Xml)
if ( Qt5Xml_FOUND ) if ( Qt5Xml_FOUND )
add_definitions( -DHAVE_XML ) add_definitions( -DHAVE_XML )
list( APPEND _extra_libraries Qt5::Xml ) list( APPEND _extra_libraries Qt5::Xml )
list( APPEND _extra_src ItemAppData.cpp ) list( APPEND _extra_src ItemAppData.cpp )
endif() 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) find_package(AppStreamQt)
set_package_properties( set_package_properties(
AppStreamQt PROPERTIES AppStreamQt PROPERTIES
@ -25,6 +33,7 @@ if ( AppStreamQt_FOUND )
list( APPEND _extra_libraries AppStreamQt ) list( APPEND _extra_libraries AppStreamQt )
list( APPEND _extra_src ItemAppStream.cpp ) list( APPEND _extra_src ItemAppStream.cpp )
endif() endif()
endif()
calamares_add_plugin( packagechooser calamares_add_plugin( packagechooser
TYPE viewmodule TYPE viewmodule