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

Handle correctly QT_PRIVATE assignments when converting to CMake

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P1: Critical
    • None
    • None
    • Build System
    • None

    Description

      As uncovered by the failing qtquickcontrols2 tst_focus, we don't correctly handle QT_PRIVATE assignments when converting to CMake.

      Any module that has QT_PRIVATE += opengl-private assignment we currently interpret as

      qt_extend_target(Quick LIBRARIES Qt::OpenGLPrivate)
      

      which under the hood in a loop in qt_extend_target makes QuickPrivate depend on OpenGLPrivate, which is incorrect.

      Instead we need to change pro2cmake to generate code like his for the following .pro snippet:

      TARGET = quick
      QT += gui-private
      QT_PRIVATE += opengl-private
      
      # Make Quick depend on QuickPrivate privately in add_qt_module(Quick) in QtBuild.cmake, and do the following
      
      target_link_libraries(QuickPrivate
         INTERFACE Qt::GuiPrivate
      )
      target_link_libraries(Quick
         PRIVATE Qt::OpenGLPrivate
      )
      

      Note the usage of a simple target_link_libraries instead of qt_extend_target.

      Attachments

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

        Activity

          People

            alexandru.croitor Alexandru Croitor
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes