mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
Tests: Add QtAutogen test for a low cmake_minimum_required version
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# Autogen tests common for Qt4 and Qt5
|
||||
ADD_AUTOGEN_TEST(Complex QtAutogen)
|
||||
ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
|
||||
ADD_AUTOGEN_TEST(MocOnly mocOnly)
|
||||
ADD_AUTOGEN_TEST(MocOptions mocOptions)
|
||||
ADD_AUTOGEN_TEST(UicOnly uicOnly)
|
||||
@@ -35,7 +37,6 @@ ADD_AUTOGEN_TEST(Parallel4 parallel4)
|
||||
ADD_AUTOGEN_TEST(ParallelAUTO parallelAUTO)
|
||||
ADD_AUTOGEN_TEST(SameName sameName)
|
||||
ADD_AUTOGEN_TEST(StaticLibraryCycle slc)
|
||||
ADD_AUTOGEN_TEST(Complex QtAutogen)
|
||||
# Rerun tests
|
||||
ADD_AUTOGEN_TEST(RerunMocBasic)
|
||||
if(NOT QT_TEST_VERSION STREQUAL 4)
|
||||
|
||||
16
Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
Normal file
16
Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
# Use a low minimum version
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(LowMinimumVersion)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
add_executable(lowMinimumVersion
|
||||
main.cpp
|
||||
item.hpp
|
||||
item.cpp
|
||||
view.ui
|
||||
someText.txt
|
||||
example.qrc)
|
||||
target_link_libraries(lowMinimumVersion ${QT_QTCORE_TARGET})
|
||||
5
Tests/QtAutogen/LowMinimumVersion/example.qrc
Normal file
5
Tests/QtAutogen/LowMinimumVersion/example.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="Example">
|
||||
<file>someText.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
19
Tests/QtAutogen/LowMinimumVersion/item.cpp
Normal file
19
Tests/QtAutogen/LowMinimumVersion/item.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "item.hpp"
|
||||
#include <ui_view.h>
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
Ui_View ui;
|
||||
MocLocal obj;
|
||||
}
|
||||
|
||||
#include "item.moc"
|
||||
15
Tests/QtAutogen/LowMinimumVersion/item.hpp
Normal file
15
Tests/QtAutogen/LowMinimumVersion/item.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef ITEM_HPP
|
||||
#define ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
|
||||
#endif
|
||||
10
Tests/QtAutogen/LowMinimumVersion/main.cpp
Normal file
10
Tests/QtAutogen/LowMinimumVersion/main.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "item.hpp"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(example);
|
||||
Item item;
|
||||
item.go();
|
||||
|
||||
return 0;
|
||||
}
|
||||
1
Tests/QtAutogen/LowMinimumVersion/someText.txt
Normal file
1
Tests/QtAutogen/LowMinimumVersion/someText.txt
Normal file
@@ -0,0 +1 @@
|
||||
Hello world, you're an interesting place.
|
||||
24
Tests/QtAutogen/LowMinimumVersion/view.ui
Normal file
24
Tests/QtAutogen/LowMinimumVersion/view.ui
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>View</class>
|
||||
<widget class="QWidget" name="Base">
|
||||
<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>
|
||||
Reference in New Issue
Block a user