| 1 |
# Copyright (C) 2022 The Qt Company Ltd. |
| 2 |
# SPDX-License-Identifier: BSD-3-Clause |
| 3 |
|
| 4 |
cmake_minimum_required(VERSION 3.16) |
| 5 |
if(POLICY CMP0099) |
| 6 |
cmake_policy(SET CMP0099 NEW) # Avoid CMP0099 related warnings. |
| 7 |
endif() |
| 8 |
|
| 9 |
project(test_dependent_modules) |
| 10 |
|
| 11 |
find_package(Qt6Widgets REQUIRED) |
| 12 |
|
| 13 |
set(CMAKE_AUTOMOC ON) |
| 14 |
set(CMAKE_AUTOUIC ON) |
| 15 |
set(CMAKE_AUTORCC ON) |
| 16 |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
| 17 |
|
| 18 |
# make sure CMP0071 warnings cause a test failure |
| 19 |
set(CMAKE_SUPPRESS_DEVELOPER_ERRORS FALSE CACHE INTERNAL "" FORCE) |
| 20 |
|
| 21 |
qt_wrap_cpp(moc_files mywidget.h) |
| 22 |
qt_wrap_ui(ui_files mywidget.ui) |
| 23 |
qt_add_resources(qrc_files res.qrc) |
| 24 |
|
| 25 |
add_executable(mywidget |
| 26 |
# source files |
| 27 |
mywidget.cpp |
| 28 |
mywidget.h |
| 29 |
mywidget.ui |
| 30 |
res.qrc |
| 31 |
|
| 32 |
# generated files |
| 33 |
${moc_files} |
| 34 |
${ui_files} |
| 35 |
${qrc_files} |
| 36 |
) |
| 37 |
target_link_libraries(mywidget PRIVATE Qt::Widgets) |