From dac557295bf6dfe6ededc8bad91f7a240a505333 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 21 Aug 2020 16:59:17 +0200 Subject: [PATCH] CMake: Fix tst_moc to build when tests are built as part of Qt tree tst_moc uses qt_wrap_cpp, which tries to dispatch to qt6_wrap_cpp depending on the value of QT_DEFAULT_MAJOR_VERSION. That value is only set in Qt6CoreConfigExtras.cmake.in, which is not loaded as part of the qtbase build unless something does find_package(Qt6Core). Set the QT_DEFAULT_MAJOR_VERSION to 6 before including the Qt6CoreMacros in the qtbase top-level project. Change-Id: I7b81d89d965f755e51727007e68771ac3931ac55 Reviewed-by: Joerg Bornemann --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e31224ee4f..6aed77873d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,7 @@ if(NOT QT_BUILD_STANDALONE_TESTS) qt_set_language_standards() #include CoreMacros() for qt6_generate_meta_types() + set(QT_DEFAULT_MAJOR_VERSION 6) include(src/corelib/Qt6CoreMacros.cmake) # Needed when building qtbase for android.