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

[REG 5->6] Qt6::qmake not usable in CMake configuration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.0.0
    • Build System: CMake
    • None
    • Ubuntu 18.04
    • Linux/X11

    Description

      Using the following as a test, I believe Qt6::qmake is not setup correct to point to an executable.

      cmake_minimum_required(VERSION 3.19)

      project(Qt6Tutorial)

      set(CMAKE_AUTOMOC ON)
      set(CMAKE_AUTOUIC ON)

      find_package(Qt6 COMPONENTS CoreTools UiTools LinguistTools Widgets OpenGL OpenGLWidgets REQUIRED CONFIG)

      set(some_file ${CMAKE_CURRENT_BINARY_DIR}/output.txt)
      execute_process(COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qmake -query
      {{ OUTPUT_FILE ${some_file}}}
      {{ )}}
      {{#execute_process(COMMAND ls /tmp }}
      {{# OUTPUT_FILE ${some_file} }}
      # )

       

      Comparing the setup for ::qmake in the CMake configuration on Qt5, I see the following (in Qt5CoreConfigExtras.cmake)
       
      if (NOT TARGET Qt5::qmake)
          add_executable(Qt5::qmake IMPORTED)

          set(imported_location "${_qt5Core_install_prefix}/bin/qmake")
          _qt5_Core_check_file_exists(${imported_location})

          set_target_properties(Qt5::qmake PROPERTIES
              IMPORTED_LOCATION ${imported_location}
          )
      endif()
       
      Whereas in Qt6, I can only find this (in Qt6CoreToolsAdditionalTargetInfo.cmake)
       
      # Default configuration                                              }}{{if(_qt_imported_location_default)
          set_property(TARGET Qt6::qmake PROPERTY IMPORTED_LOCATION "${_qt_imported_location_default}")
      endif()
       
      this lead me to believe that Qt6::qmake is not setup correctly.
       

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            nicholas_yue Nicholas Yue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes