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

qt_generate_foreign_qml_types can't extract metatypes for target created in different directory scope

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.2, 6.7.0 RC
    • Build System: CMake
    • None

    Description

      If I use "qt_generate_foreign_qml_types" for a library in a subdirectory qmltyperegistrar fails to generate the file.

      [11/27] Generate QML registration code for target ui_base
      FAILED: ui_base_ui_qml.cpp ui_base_ui_qml.h /tmp/o/ui_base_ui_qml.cpp /tmp/o/ui_base_ui_qml.h 
      cd /tmp/o && /usr/lib/qt6/qmltyperegistrar --extract -o ui_base_ui_qml /tmp/o/base/meta_types/qt6ui_base_metatypes.json
      Error 5 while parsing /tmp/o/base/meta_types/qt6ui_base_metatypes.json: illegal value
      ninja: build stopped: subcommand failed.
      

      If I move the stuff from "add_subdirectory(base)" into the main CMakeLists.txt it works in attached example. But I cannot move those components in my real world app.

      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
              misery André Klitzing
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes