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

ninja dependency error when configuring a project that uses AUTOUIC and CMake 3.21.0

    XMLWordPrintable

Details

    Description

      Some Qt builds in CI failed when configured with CMake 3.21.0

      Job https://testresults.qt.io/coin/integration/qt/qt5/tasks/web_qt_qt5_1626704027212
      https://codereview.qt-project.org/c/qt/qt5/+/360035

      There were two failures.

      One in an example in qtscxml

      https://testresults.qt.io/coin/logview/qt/qtscxml/4c08b44e476d6da2b285f8d698c89f957bada5e5/WindowsWindows_10x86_64WindowsWindows_10x86_64MSVC2019qtci-windows-10-x86_64-52-83a968DebugAndRelease_Sccache/dd8bffa995fe1e0eaa0da84461750df760f5341c/build_1626705926

      ninja: error: 'C:/Users/qt/work/qt/qtscxml/examples/scxml/mediaplayer-widgets-static/mediaplayer-widgets-static_autogen/mocs_compilation_Debug.cpp', needed by 'examples/scxml/mediaplayer-widgets-static/CMakeFiles/mediaplayer-widgets-static.dir/Debug/mediaplayer-widgets-static_autogen/mocs_compilation_Debug.cpp.obj', missing and no known rule to make it
      

      another in qttools itself

      https://testresults.qt.io/coin/logview/qt/qttools/61f398c77280c146194d33516a5567869e048c06/WindowsWindows_10x86_64WindowsWindows_10x86_64MSVC2019qtci-windows-10-x86_64-52-83a968DebugAndRelease_Sccache/075743c2880ef30a78e9e8db532b2502c5c195db/build_1626705894

      ninja: error: 'C:/Users/qt/work/qt/qttools/src/designer/src/lib/Designer_autogen/mocs_compilation_Debug.cpp', needed by 'src/designer/src/lib/CMakeFiles/Designer.dir/Debug/Designer_autogen/mocs_compilation_Debug.cpp.obj', missing and no known rule to make it
      

      The issue needs a bunch of conditions to reproduce.
      CMake 3.21.0 + Ninja Multi-Config generator, cross config mode enabled, the project using a .ui file + AUTOUIC + AUTOMOC, the .ui file needs to be in some parent directory relative to the target that includes it.

      The issue does not reproduce with CMake 3.20.5.

      Attaching minimal repro project.

      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
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: