From f523d1da91dbf944cb753e8aed8ad40367e8826c Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Fri, 11 Feb 2022 12:29:50 +0100 Subject: [PATCH] Hide finding docs dependencies behind ENABLE_DOCS It was also oddly placed within CMakeLists.txt so moved it below major Qt dependency calls (and the actual "# Dependencies" block). Signed-off-by: Andreas Sturmlechner --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea764a..48623bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,6 @@ include(ECMGeneratePriFile) include(FeatureSummary) include(GenerateExportHeader) -if(QT_MAJOR_VERSION STREQUAL "5") - find_package(Qt5 CONFIG OPTIONAL_COMPONENTS DocTools) -else() - find_package(Qt6 CONFIG OPTIONAL_COMPONENTS ToolsTools) -endif() - ecm_setup_version(PROJECT VARIABLE_PREFIX KUSERFEEDBACK VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kuserfeedback_version.h" @@ -61,6 +55,14 @@ if (NOT CMAKE_CROSSCOMPILING) find_package(Qt${QT_MAJOR_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS Help) endif() +if (ENABLE_DOCS) + if(QT_MAJOR_VERSION STREQUAL "5") + find_package(Qt5 CONFIG OPTIONAL_COMPONENTS DocTools) + else() + find_package(Qt6 CONFIG OPTIONAL_COMPONENTS ToolsTools) + endif() +endif() + set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES URL "http://qt-project.org/") set_package_properties(Qt${QT_MAJOR_VERSION}Widgets PROPERTIES TYPE RECOMMENDED PURPOSE "Required for feedback configuration and notification widgets.") set_package_properties(Qt${QT_MAJOR_VERSION}Charts PROPERTIES TYPE RECOMMENDED PURPOSE "Required for UserFeedbackConsole.") -- 2.35.1