Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114587

Provide CMake file for user projects to support newer CMake API in older Qt versions

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 6.5.1
    • Build System: CMake
    • None
    • All

    Description

      It would be nice if users could copy a CMake include file into their project that provides newer CMake API for older Qt versions. Qt VS Tools provides a qt.cmake that gets includes after the find_package(Qt...) call:

      if(QT_VERSION VERSION_LESS 6.3)
          macro(qt_standard_project_setup)
              set(CMAKE_AUTOMOC ON)
              set(CMAKE_AUTOUIC ON)
          endmacro()
      endif()
      
      if(QT_VERSION VERSION_LESS 6.0)
          macro(qt_add_executable name)
               if(ANDROID)
                  add_library(name SHARED ${ARGN})
              else()
                  add_executable(${ARGV})
              endif()
          endmacro()
      endif()
      

      Qt Creator and Visual Studio Code could also benefit from such a file that's pulled in from the newest known Qt version and updated in the user project (on request or with user confirmation).

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes