CMake: optionally disable QML

This makes it possible to remove QML from Calamares, possibly yielding
a smaller, lighter installer; it takes with it the nice slideshow,
modern configurable navigation and the QML UIs built for various modules.

By default, WITH_QML is on and the "normal" feature set is retained.

- look for Qml modules only when WITH_QML is on (the default)
- look for Network, since that's pulled in only implicitly
- disable the QML Calamares models (modules/*q) if no QML is
  enabled; longer-term plan is to merge the **pages** back to
  the "upstream" modules, and have things be run-time switchable,
  but that's not here yet. Also disable the notesqml module when
  QML is off.
This commit is contained in:
Adriaan de Groot 2020-05-14 15:54:19 +02:00
parent 0235245631
commit 47979555fe
6 changed files with 27 additions and 2 deletions

View File

@ -56,7 +56,8 @@ option( WITH_KF5DBus "Use DBus service for unique-application." OFF )
# When adding WITH_* that affects the ABI offered by libcalamares,
# also update libcalamares/CalamaresConfig.h.in
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF )
option( WITH_PYTHONQT "Enable Python view modules API (deprecated, requires PythonQt)." OFF )
option( WITH_QML "Enable QML UI options." ON )
# Possible debugging flags are:
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
@ -253,7 +254,10 @@ include( CMakeColors )
### DEPENDENCIES
#
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui Widgets LinguistTools Svg Quick QuickWidgets )
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTools Network Svg Widgets )
if( WITH_QML )
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets )
endif()
if( Qt5_VERSION VERSION_GREATER 5.12.1 )
# At least Qt 5.12.2 seems to support Esperanto in QLocale
if( "eo" IN_LIST _tx_incomplete )

View File

@ -11,5 +11,6 @@
//cmakedefines for CMake variables (e.g. for optdepends) go here
#cmakedefine WITH_PYTHON
#cmakedefine WITH_PYTHONQT
#cmakedefine WITH_QML
#endif // CALAMARESCONFIG_H

View File

@ -1,3 +1,8 @@
if( NOT WITH_QML )
calamares_skip_module( "keyboardq (QML is not supported in this build)" )
return()
endif()
set( _keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard )
include_directories( ${_keyboard} )

View File

@ -1,3 +1,8 @@
if( NOT WITH_QML )
calamares_skip_module( "localeq (QML is not supported in this build)" )
return()
endif()
# When debugging the timezone widget, add this debugging definition
# to have a debugging-friendly timezone widget, debug logging,
# and no intrusive timezone-setting while clicking around.

View File

@ -1,3 +1,8 @@
if( NOT WITH_QML )
calamares_skip_module( "notesqml (QML is not supported in this build)" )
return()
endif()
calamares_add_plugin( notesqml
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO

View File

@ -1,6 +1,11 @@
# This is a re-write of the welcome module using QML view steps
# instead of widgets.
if( NOT WITH_QML )
calamares_skip_module( "welcomeq (QML is not supported in this build)" )
return()
endif()
set( _welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome )
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ${CMAKE_CURRENT_SOURCE_DIR}/../../libcalamares ${_welcome} )