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

qt6_add_qml_module only works when used in same folder than the backing library

    XMLWordPrintable

    Details

    • Platform/s:
      All

      Description

      If you try to use the qt6_add_qml_module function to create a plugin using an already existing library as a backing library and this library is build in a different folder (different CMakeLists.txt) the configure step fails with the following error:

      CMake Error at /home/gagi/work/build/qt6/qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2020 (add_library):
        Cannot find source file:
      
          .../mytestlib_qmltyperegistrations.cpp
      
        Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
        .hpp .hxx .in .txx
      

      When using the qt6_add_qml_module function in the same CMakeLists.txt than the backing library it works as intended.

      This is especially a problem when porting bigger qmake projects, as those usually have their libraries and plugins split into different folders and reusing this folder structure is not possible.

        Attachments

        For Gerrit Dashboard: QTBUG-95200
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            crscott Craig Scott
            Reporter:
            gagi Dominik Holland
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: