From ee80eec19ad6cfc207b7970e2e6080ea00335d96 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Mon, 1 Aug 2022 12:41:12 +0200 Subject: Add explicit option to disable QML support We've had multiple people accidentally building KConfig without QML support and then complain that something down the line is breaking To make that harder add an explict option to disable the QML stuff --- CMakeLists.txt | 7 ++++++- src/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 214b7423..7df1191e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,12 @@ option(KCONFIG_USE_GUI "Build components using Qt${QT_MAJOR_VERSION}Gui" ON) if(KCONFIG_USE_GUI) find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) endif() -find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} OPTIONAL_COMPONENTS Qml) + +option(KCONFIG_USE_QML "Build components using Qt${QT_MAJOR_VERSION}Qml" ON) + +if(KCONFIG_USE_QML) + find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Qml) +endif() if (NOT ANDROID) set(default_kconfig_use_dbus ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 715890e0..2e05c615 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ add_subdirectory(core) if(TARGET Qt${QT_MAJOR_VERSION}::Gui) add_subdirectory(gui) endif() -if(TARGET Qt${QT_MAJOR_VERSION}::Qml) +if(KCONFIG_USE_QML) add_subdirectory(qml) endif() add_subdirectory(kconfig_compiler) -- cgit v1.2.1