From 2f2062114c4312f669bd5d101bbd1ec083e4f5a7 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Tue, 30 Nov 2021 17:01:46 +0100 Subject: Include QtVersionOption before all Qt5 find_package calls This doesn't make all these modules actually work with Qt6 yet, but it prevents them from unconditionally pulling in Qt5 in a Qt6 build. This is useful in order to even be able to pass a CMake run to the point one can port, test and debug the rest. --- modules/ECMAddQch.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/ECMAddQch.cmake') diff --git a/modules/ECMAddQch.cmake b/modules/ECMAddQch.cmake index 8ba91768..f494c543 100644 --- a/modules/ECMAddQch.cmake +++ b/modules/ECMAddQch.cmake @@ -257,6 +257,7 @@ Since 5.36.0. #]=======================================================================] include(CMakeParseArguments) +include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake) include(ECMQueryQmake) @@ -279,7 +280,7 @@ function(_ecm_ensure_qt_qch_targets) # Ideally one day Qt CMake Config files provide these if(NOT TARGET Qt5Core_QCH) # get Qt version, if any - find_package(Qt5Core CONFIG QUIET) + find_package(Qt${QT_MAJOR_VERSION}Core CONFIG QUIET) # lookup tag files query_qmake(qt_docs_dir QT_INSTALL_DOCS TRY) find_path(_qtcoreTagsPath qtcore/qtcore.tags -- cgit v1.2.1