summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
diff options
context:
space:
mode:
authorJiDe Zhang <zhangjide@uniontech.com>2021-01-16 04:27:39 +0800
committerAlexey Edelev <alexey.edelev@qt.io>2021-04-28 09:24:42 +0200
commit38564297e778f2197ceb1d829741192d44bb6082 (patch)
treed42b23fda48eb0ce32f64520a7f26c44df82f7c0 /tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
parent73621cbf0a5f53990b2c7a966bc6fd71299ec8fe (diff)
fix: The QtStartUpFunction function may be called repeatedly
Don't call pre routine function in qAddPreRoutine if the qt_call_pre_routines is not called Task-number: QTBUG-90341 Change-Id: I0ee70561dc57b857f8b3b1cf42c9dfe0cf45bd49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 22e967c3049608f82abd32a0beb0b4b36ee134bf)
Diffstat (limited to 'tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
new file mode 100644
index 0000000000..aab144e520
--- /dev/null
+++ b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
@@ -0,0 +1,48 @@
+#####################################################################
+## tst_qaddpreroutine Test:
+#####################################################################
+cmake_minimum_required(VERSION 3.16)
+
+if(DEFINED CMAKE_Core_MODULE_MAJOR_VERSION)
+ set(project_version "${CMAKE_Core_MODULE_MAJOR_VERSION}.\
+${CMAKE_Core_MODULE_MINOR_VERSION}.${CMAKE_Core_MODULE_PATCH_VERSION}"
+ )
+else()
+ set(project_version "6.0.0")
+endif()
+
+project(tst_qaddpreroutine
+ LANGUAGES CXX
+ VERSION "${project_version}"
+)
+
+find_package(Qt6 COMPONENTS Core BuildInternals CONFIG REQUIRED)
+qt_prepare_standalone_project()
+
+find_package(Qt6 COMPONENTS Gui Test CONFIG REQUIRED)
+
+qt_internal_add_plugin(QTBUG_90341ThemePlugin
+ OUTPUT_NAME QTBUG_90341
+ OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ TYPE platformthemes
+ DEFAULT_IF FALSE
+ SOURCES
+ plugin.cpp
+ SKIP_INSTALL
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::GuiPrivate
+)
+
+qt_internal_add_test(tst_qaddpreroutine
+ SOURCES
+ tst_qaddpreroutine.cpp
+ PUBLIC_LIBRARIES
+ Qt::Gui
+)
+
+qt6_import_plugins(tst_qaddpreroutine INCLUDE QTBUG_90341)
+
+target_compile_definitions(tst_qaddpreroutine
+ PRIVATE QT_QPA_PLATFORM_PLUGIN_PATH=\"${CMAKE_BINARY_DIR}\")