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

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

      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).

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes