diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-08-30 17:41:27 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-01 10:00:51 +0000 |
commit | 854bdc6a16fc3ff98c537e87b5fea8f90c67b96c (patch) | |
tree | 3cec80ce4304c959fc9c80052049f4069aaeb753 | |
parent | a8a3d437167c3f9446feee5f0b04d54c887677a3 (diff) |
Simplify test examples target includes
Fix condition to include examples and tests based
on targets. We are no longer behind external project
so we can simply check for targets.
Fix issue for including automoc call when running qt
configure when doing top level build.
Task-number: QTBUG-95590
Change-Id: I0cd2d8016e14ddf296455277e968b43a923a7217
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit faa74f9b402f6b5d78acdb71b05ca340684b3591)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/CMakeLists.txt | 8 | ||||
-rw-r--r-- | tests/auto/CMakeLists.txt | 14 | ||||
-rw-r--r-- | tests/auto/httpserver/httpserver.cmake | 6 |
3 files changed, 12 insertions, 16 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 54e8d5006..e17626721 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,16 +2,16 @@ cmake_minimum_required(VERSION 3.16) qt_examples_build_begin() if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533 - if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build) + if(TARGET Qt::WebEngineCore) add_subdirectory(webengine) endif() - if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_widgets_build) + if(TARGET Qt::WebEngineWidgets) add_subdirectory(webenginewidgets) endif() - if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_quick_build) + if(TARGET Qt::Pdf) add_subdirectory(pdf) endif() - if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_widgets_build) + if(TARGET Qt::PdfWidgets) add_subdirectory(pdfwidgets) endif() endif() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 1e5c1f6bd..e000203d9 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,18 +1,14 @@ -if(QT_FEATURE_qtwebengine_build - OR (QT_BUILD_STANDALONE_TESTS AND TARGET Qt::WebEngineCore)) - add_subdirectory(core) +if(TARGET Qt::WebEngineCore) add_subdirectory(httpserver) add_subdirectory(util) + add_subdirectory(core) endif() -if(QT_FEATURE_qtwebengine_quick_build - OR (QT_BUILD_STANDALONE_TESTS AND TARGET Qt::WebEngineQuick)) +if(TARGET Qt::WebEngineQuick) add_subdirectory(quick) endif() -if(QT_FEATURE_qtwebengine_widgets_build - OR (QT_BUILD_STANDALONE_TESTS AND TARGET Qt::WebEngineWidgets)) +if(TARGET Qt::WebEngineWidgets) add_subdirectory(widgets) endif() -if(QT_FEATURE_qtpdf_build - OR (QT_BUILD_STANDALONE_TESTS AND TARGET Qt::Pdf)) +if(TARGET Qt::Pdf) add_subdirectory(pdf) endif() diff --git a/tests/auto/httpserver/httpserver.cmake b/tests/auto/httpserver/httpserver.cmake index e10c52b76..d67648f9c 100644 --- a/tests/auto/httpserver/httpserver.cmake +++ b/tests/auto/httpserver/httpserver.cmake @@ -1,8 +1,8 @@ if (NOT TARGET Test::HttpServer) - set(CMAKE_AUTOMOC ON) - set(CMAKE_AUTORCC ON) - set(CMAKE_AUTOUIC ON) + if(NOT QT_SUPERBUILD AND NOT QT_CONFIGURE_RUNNING) + set(CMAKE_AUTOMOC ON) + endif() add_library(httpserver STATIC ${CMAKE_CURRENT_LIST_DIR}/httpreqrep.cpp |