mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 16:55:25 +08:00
qt 6.5.1 original
This commit is contained in:
33
tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
Normal file
33
tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(test_testlib_definitions)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
macro(test_testlib_project _module)
|
||||
find_package(Qt6${_module} REQUIRED)
|
||||
find_package(Qt6Test REQUIRED)
|
||||
|
||||
set(main_file "${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp")
|
||||
set(moc_file "${CMAKE_CURRENT_BINARY_DIR}/main.moc")
|
||||
|
||||
qt_generate_moc("${main_file}" "${moc_file}")
|
||||
|
||||
add_executable(testapp_${_module} "${main_file}" "${moc_file}")
|
||||
target_link_libraries(testapp_${_module}
|
||||
Qt::${_module}
|
||||
Qt::Test
|
||||
)
|
||||
endmacro()
|
||||
|
||||
add_subdirectory(core_only)
|
||||
if(NOT NO_GUI)
|
||||
add_subdirectory(gui)
|
||||
endif()
|
||||
if(NOT NO_WIDGETS)
|
||||
add_subdirectory(widgets)
|
||||
endif()
|
@ -0,0 +1,7 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
project(core_only)
|
||||
|
||||
test_testlib_project(Core)
|
@ -0,0 +1,7 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
project(gui)
|
||||
|
||||
test_testlib_project(Gui)
|
20
tests/auto/cmake/test_testlib_definitions/main.cpp
Normal file
20
tests/auto/cmake/test_testlib_definitions/main.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
class TestObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestObject(QObject *parent = nullptr)
|
||||
: QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_MAIN(TestObject)
|
||||
|
||||
#include "main.moc"
|
@ -0,0 +1,7 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
project(widgets)
|
||||
|
||||
test_testlib_project(Widgets)
|
Reference in New Issue
Block a user