[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,25 +5,34 @@ set( _extra_src "" )
### OPTIONAL AppData XML support in PackageModel ### OPTIONAL AppData XML support in PackageModel
# #
# #
find_package(Qt5 COMPONENTS Xml) option( WITH_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON )
if ( Qt5Xml_FOUND ) if ( WITH_APPDATA )
add_definitions( -DHAVE_XML ) find_package(Qt5 COMPONENTS Xml)
list( APPEND _extra_libraries Qt5::Xml ) if ( Qt5Xml_FOUND )
list( APPEND _extra_src ItemAppData.cpp ) add_definitions( -DHAVE_XML )
list( APPEND _extra_libraries Qt5::Xml )
list( APPEND _extra_src ItemAppData.cpp )
endif()
endif() endif()
find_package(AppStreamQt) ### OPTIONAL AppStream support in PackageModel
set_package_properties( #
AppStreamQt PROPERTIES #
DESCRIPTION "Support for AppStream (cache) data" option( WITH_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON )
URL "https://github.com/ximion/appstream" if ( WITH_APPSTREAM )
PURPOSE "AppStream provides package data" find_package(AppStreamQt)
TYPE OPTIONAL set_package_properties(
) AppStreamQt PROPERTIES
if ( AppStreamQt_FOUND ) DESCRIPTION "Support for AppStream (cache) data"
add_definitions( -DHAVE_APPSTREAM ) URL "https://github.com/ximion/appstream"
list( APPEND _extra_libraries AppStreamQt ) PURPOSE "AppStream provides package data"
list( APPEND _extra_src ItemAppStream.cpp ) TYPE OPTIONAL
)
if ( AppStreamQt_FOUND )
add_definitions( -DHAVE_APPSTREAM )
list( APPEND _extra_libraries AppStreamQt )
list( APPEND _extra_src ItemAppStream.cpp )
endif()
endif() endif()
calamares_add_plugin( packagechooser calamares_add_plugin( packagechooser