diff options
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r-- | examples/CMakeLists.txt | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b473828415..d1b6b67aa0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,54 +1,51 @@ -# special case begin -qt_examples_build_begin() +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -# special case end +if(QT_BUILD_STANDALONE_EXAMPLES) + # Needed for early feature values, despite it being found later on in qt_build_tests(). + # Needs to be find_package, not qt_find_package, because qt_find_package doesn't handle finding + # component for a super-package that has already been found. + find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core) -# Generated from examples.pro. + # Modify the optimization flags specifically for qtbase standalone examples. Other projects + # are handled by qt_enable_cmake_languages(). + qt_internal_set_up_config_optimizations_like_in_qmake() +endif() -add_subdirectory(corelib) -add_subdirectory(embedded) -add_subdirectory(qpa) +qt_examples_build_begin(EXTERNAL_BUILD) -if(TARGET Qt::DBus) +add_compile_definitions(QT_NO_CONTEXTLESS_CONNECT) + +add_subdirectory(corelib) +if(TARGET Qt6::DBus) add_subdirectory(dbus) endif() - -if(TARGET Qt::Network) +if(TARGET Qt6::Network) add_subdirectory(network) endif() - -if(TARGET Qt::Test) +if(TARGET Qt6::Test) add_subdirectory(qtestlib) endif() - -if(TARGET Qt::Concurrent) +if(TARGET Qt6::Concurrent) add_subdirectory(qtconcurrent) endif() - -if(TARGET Qt::Sql) +if(TARGET Qt6::Sql) add_subdirectory(sql) endif() - -if(TARGET Qt::Widgets) +if(TARGET Qt6::Widgets) add_subdirectory(widgets) endif() - -if(TARGET Qt::Xml) +if(TARGET Qt6::Xml) add_subdirectory(xml) endif() - -if(TARGET Qt::Gui) +if(TARGET Qt6::Gui) add_subdirectory(gui) - - if(QT_FEATURE_opengl) - add_subdirectory(opengl) - endif() - - if(QT_FEATURE_vulkan) - add_subdirectory(vulkan) - endif() +endif() +if(QT_FEATURE_opengl AND TARGET Qt6::Gui) + add_subdirectory(opengl) +endif() +if(QT_FEATURE_vulkan AND TARGET Qt6::Gui) + add_subdirectory(vulkan) endif() -# special case begin qt_examples_build_end() -# special case end |