From 7c5540a1344c267c44dd08b49c3713ba0049f27a Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 2 Nov 2024 11:18:05 +0100 Subject: [PATCH] chore: build demo and tests only when QML modules are built --- CMakeLists.txt | 12 ++++++------ features.cmake | 34 ++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 644f5420..9f0a5248 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,10 @@ if(FLUID_WITH_QML_MODULES) add_subdirectory(src/imports/controls) add_subdirectory(src/imports/private) add_subdirectory(src/imports/templates) -endif() -if(FLUID_WITH_DEMO) - add_subdirectory(src/demo) -endif() -if(BUILD_TESTING) - add_subdirectory(tests/auto) + if(FLUID_WITH_DEMO) + add_subdirectory(src/demo) + endif() + if(BUILD_TESTING) + add_subdirectory(tests/auto) + endif() endif() diff --git a/features.cmake b/features.cmake index 952bb2a7..c24045ee 100644 --- a/features.cmake +++ b/features.cmake @@ -4,22 +4,24 @@ ## Enable feature summary at the end of the configure run: include(FeatureSummary) -## Find Qt: -find_package(Qt6 "6.7.0" - REQUIRED - COMPONENTS - Core - Gui - Svg - Qml - Quick - QuickControls2 - QuickTest -) - -## Qt policies: -if(QT_KNOWN_POLICY_QTP0004) - qt6_policy(SET QTP0004 NEW) +if(FLUID_WITH_QML_MODULES) + ## Find Qt: + find_package(Qt6 "6.7.0" + REQUIRED + COMPONENTS + Core + Gui + Svg + Qml + Quick + QuickControls2 + QuickTest + ) + + ## Qt policies: + if(QT_KNOWN_POLICY_QTP0004) + qt6_policy(SET QTP0004 NEW) + endif() endif() #### Features