qt5base-lts/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
Alexandru Croitor 0da123d67b CMake: Bump almost all cmake_minimum_required calls to 3.16
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.

Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-09-22 19:36:49 +02:00

35 lines
754 B
CMake

cmake_minimum_required(VERSION 3.16)
if(POLICY CMP0099)
cmake_policy(SET CMP0099 NEW) # Avoid CMP0099 related warnings.
endif()
project(test_dependent_modules)
find_package(Qt6Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# make sure CMP0071 warnings cause a test failure
set(CMAKE_SUPPRESS_DEVELOPER_ERRORS FALSE CACHE INTERNAL "" FORCE)
qt_wrap_cpp(moc_files mywidget.h)
qt_wrap_ui(ui_files mywidget.ui)
qt_add_resources(qrc_files res.qrc)
add_executable(mywidget
# source files
mywidget.cpp
mywidget.h
mywidget.ui
res.qrc
# generated files
${moc_files}
${ui_files}
${qrc_files}
)
target_link_libraries(mywidget PRIVATE Qt::Widgets)