Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32578

Auto geneated CMakeLists.txt ni QTest template seems a bit outdated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • Qt Creator 15.0.1
    • Test Integration
    • None
    • 5e7c9a188 (17.0)

    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) 

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-32578
          # Subject Branch Project Status CR V

          Activity

            People

              cstenger Christian Stenger
              mikio_hirai Mikio Hirai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes