summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Autogen_4
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-06-21 13:41:44 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-06-24 13:00:51 (GMT)
commit6ee5c431d5a7217b12268cc6ccc1ac62625abf4f (patch)
treedd05891c6b3c428ed9bb0cd1528fa10d5c6eb369 /Tests/RunCMake/Autogen_4
parentb83fabd0d3e29247618f6cd8e975894096e17a66 (diff)
downloadCMake-6ee5c431d5a7217b12268cc6ccc1ac62625abf4f.zip
CMake-6ee5c431d5a7217b12268cc6ccc1ac62625abf4f.tar.gz
CMake-6ee5c431d5a7217b12268cc6ccc1ac62625abf4f.tar.bz2
Autogen: Separate RunCMake.AutogenQtX tests
The RunCMake.AutogenQtX tests occasionally time out so separate `RunCMake.AutogenQtX` tests. Example: https://open.cdash.org/tests/1583599782
Diffstat (limited to 'Tests/RunCMake/Autogen_4')
-rw-r--r--Tests/RunCMake/Autogen_4/AutoUicExecutableConfig.cmake15
-rw-r--r--Tests/RunCMake/Autogen_4/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Autogen_4/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/Autogen_4/UicExample.cmake11
-rw-r--r--Tests/RunCMake/Autogen_4/example_ui.cpp5
-rw-r--r--Tests/RunCMake/Autogen_4/example_ui.h14
-rw-r--r--Tests/RunCMake/Autogen_4/uiA.ui24
7 files changed, 83 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen_4/AutoUicExecutableConfig.cmake b/Tests/RunCMake/Autogen_4/AutoUicExecutableConfig.cmake
new file mode 100644
index 0000000..72a0d9f
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/AutoUicExecutableConfig.cmake
@@ -0,0 +1,15 @@
+include(UicExample.cmake)
+
+if(NOT TARGET Qt${with_qt_version}::uic)
+ message(FATAL_ERROR "Qt${with_qt_version}::uic not found")
+endif()
+
+get_target_property(uic_location Qt${with_qt_version}::uic IMPORTED_LOCATION)
+set_target_properties(dummy PROPERTIES AUTOUIC_OPTIONS "EXE_PATH=${uic_location}")
+
+add_executable(myuic $<$<CONFIG:Debug>:../Autogen_common/exe_debug.cpp>
+ $<$<CONFIG:Release>:../Autogen_common/exe_release.cpp>
+ $<$<CONFIG:RelWithDebInfo>:../Autogen_common/exe_relwithdebinfo.cpp>
+)
+
+set_target_properties(dummy PROPERTIES AUTOUIC_EXECUTABLE $<TARGET_FILE:myuic>)
diff --git a/Tests/RunCMake/Autogen_4/CMakeLists.txt b/Tests/RunCMake/Autogen_4/CMakeLists.txt
new file mode 100644
index 0000000..2632ffa
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Autogen_4/RunCMakeTest.cmake b/Tests/RunCMake/Autogen_4/RunCMakeTest.cmake
new file mode 100644
index 0000000..ac8c5d4
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/RunCMakeTest.cmake
@@ -0,0 +1,11 @@
+include(RunCMake)
+include(Autogen_common/utils)
+
+if (DEFINED with_qt_version)
+ set(RunCMake_TEST_OPTIONS
+ -Dwith_qt_version=${with_qt_version}
+ "-DQt${with_qt_version}_DIR:PATH=${Qt${with_qt_version}_DIR}"
+ "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}"
+ )
+ autogen_executable_test(Uic)
+endif ()
diff --git a/Tests/RunCMake/Autogen_4/UicExample.cmake b/Tests/RunCMake/Autogen_4/UicExample.cmake
new file mode 100644
index 0000000..4b1f8c1
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/UicExample.cmake
@@ -0,0 +1,11 @@
+enable_language(CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+
+add_library(dummy STATIC example_ui.cpp uiA.ui)
+target_link_libraries(dummy Qt${with_qt_version}::Core
+ Qt${with_qt_version}::Widgets
+ Qt${with_qt_version}::Gui)
+
+set_target_properties(dummy PROPERTIES AUTOUIC ON)
diff --git a/Tests/RunCMake/Autogen_4/example_ui.cpp b/Tests/RunCMake/Autogen_4/example_ui.cpp
new file mode 100644
index 0000000..fb97c32
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/example_ui.cpp
@@ -0,0 +1,5 @@
+#include "example_ui.h"
+
+Example::Example()
+{
+}
diff --git a/Tests/RunCMake/Autogen_4/example_ui.h b/Tests/RunCMake/Autogen_4/example_ui.h
new file mode 100644
index 0000000..d691133
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/example_ui.h
@@ -0,0 +1,14 @@
+#ifndef EXAMPLE_UI_H
+#define EXAMPLE_UI_H
+
+#include <QObject>
+
+#include "ui_uiA.h"
+
+class Example : public QObject
+{
+ Q_OBJECT
+ Example();
+};
+
+#endif
diff --git a/Tests/RunCMake/Autogen_4/uiA.ui b/Tests/RunCMake/Autogen_4/uiA.ui
new file mode 100644
index 0000000..4c5762e
--- /dev/null
+++ b/Tests/RunCMake/Autogen_4/uiA.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UiA</class>
+ <widget class="QWidget" name="UiA">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>