aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2023-04-28 16:29:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-05-03 04:23:56 +0000
commit350c664733b31f3300b9728037692a880803507b (patch)
tree64fd9461fa547ace77409912e120fa25d7814d76 /tests
parentb2e146691a3554cb3f0fdbe56b972777e40e8764 (diff)
cmake: Fix config for the networkaccessmanagerfactory manual example
Amends: d023d149d934897515a532a483def76801b93585 Change-Id: I54adf85c1ff7da2d6cc1aa13b9c9c5e1a334c1d8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c1983b446b9ba352132c9e90181197e608d7edc9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/CMakeLists.txt2
-rw-r--r--tests/manual/networkaccessmanagerfactory/CMakeLists.txt33
2 files changed, 18 insertions, 17 deletions
diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt
index 630c19fff4..0d45a56c4e 100644
--- a/tests/manual/CMakeLists.txt
+++ b/tests/manual/CMakeLists.txt
@@ -18,5 +18,5 @@ add_subdirectory(quickcontrols)
add_subdirectory(quickdialogs)
add_subdirectory(frameanimation)
if(QT_FEATURE_qml_network AND TARGET Qt::Quick)
- qt_internal_add_example(networkaccessmanagerfactory)
+ add_subdirectory(networkaccessmanagerfactory)
endif()
diff --git a/tests/manual/networkaccessmanagerfactory/CMakeLists.txt b/tests/manual/networkaccessmanagerfactory/CMakeLists.txt
index e50a97ab8c..80ab183588 100644
--- a/tests/manual/networkaccessmanagerfactory/CMakeLists.txt
+++ b/tests/manual/networkaccessmanagerfactory/CMakeLists.txt
@@ -1,36 +1,37 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-cmake_minimum_required(VERSION 3.16)
-project(networkaccessmanagerfactory LANGUAGES CXX)
+if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(networkaccessmanagerfactory LANGUAGES CXX)
+ find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Qml Quick Test)
+ find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
+endif()
set(CMAKE_AUTOMOC ON)
+qt_internal_add_manual_test(networkaccessmanagerfactory
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Qml
+ Qt::Quick
+)
+
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/networkaccessmanagerfactory")
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Qml Quick)
-
-qt_add_executable(networkaccessmanagerfactory
- main.cpp
-)
-
set_target_properties(networkaccessmanagerfactory PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(networkaccessmanagerfactory PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Network
- Qt::Qml
- Qt::Quick
-)
-
qt_add_qml_module(networkaccessmanagerfactory
URI Example
QML_FILES view.qml