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: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 15.0.1
    • Test Integration
    • 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) 

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes