Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 15.0.1
-
None
Description
Qt Creator allows the creation of QTest project template.
But the generated CMakeLists.txt seems a bit outdated, such as, it doesn't use qt_standard_project_setup(), it uses C++ 11, it uses add_executable(), not qt_add_executable(), etc. I think this template should be reviewed and updated by experts.
cmake_minimum_required(VERSION 3.16) project(DummyTest LANGUAGES CXX)enable_testing() find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Test) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(DummyTest tst_dummytest.cpp) add_test(NAME DummyTest COMMAND DummyTest) target_link_libraries(DummyTest PRIVATE Qt${QT_VERSION_MAJOR}::Test)