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

AUTOUIC can't handle relative paths referring to parent dirs with Ninja Multi-Config

    XMLWordPrintable

Details

    • 4e70ab5ee (dev), 15cfb9392 (dev), 4a71a001a (tqtc/lts-6.5), 545b84b93 (dev)

    Description

      Upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/25195

      Project

      cmake_minimum_required(VERSION 3.16)
      if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
          set(CMAKE_CROSS_CONFIGS "all" CACHE STRING "")
          set(CMAKE_DEFAULT_BUILD_TYPE "RelWithDebInfo" CACHE STRING "")
          set(CMAKE_DEFAULT_CONFIGS "all" CACHE STRING "")
      endif()
      project(proj LANGUAGES CXX)
      
      find_package(Qt6 REQUIRED COMPONENTS Core Gui)
      
      set(CMAKE_AUTOUIC ON)
      add_executable(app
          foo.cpp
          ../problematic.ui
          regular.ui
      )
      
      #set_property(TARGET "app"
      #PROPERTY EXCLUDE_FROM_ALL "$<NOT:$<CONFIG:RelWithDebInfo>>")
      

      Configure

      qt-cmake .. "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug" "-GNinja Multi-Config"
      

      Build

      $ ninja
      ninja: error: 'app_autogen/include_Debug/ui_regular.h', needed by 'app_autogen:Debug', missing and no known rule to make it
      

      Discovered and refined to the above reproducer, while investigating a failure on Windows when trying to build examples as external projects.

      https://codereview.qt-project.org/c/qt/qt5/+/431085/2#message-a4a1d14fbe9e2d70cd2cd50df17ec80702ca27ba

      https://testresults.qt.io/coin/integration/qt/qt5/tasks/web_qt_qt5_1667580188137

      https://testresults.qt.io/coin/logview/qt/qttools/f86d45fd6b83dd60863aaa6a68bcc8525eabca07/WindowsWindows_10_21H2x86_64WindowsWindows_10_21H2x86_64MSVC2019qtci-windows-10_21H2-x86_64-51-a209fdConan_DebugAndRelease_Sccache_UseConfigure_WarningsAreErrors/f0700752a0d6879a20dcf362533810bcfe4ad5f0/build_1679375462

      agent:2022/11/04 20:23:10 build.go:394: ninja: error: 'src/designer/src/designer/designer_autogen/include_Debug/ui_preferencesdialog.h', needed by 'src/designer/src/designer/designer_autogen:Debug', missing and no known rule to make it
      

      The way it's triggered in qttools is due to all example external projects depending on all targets in $repo/src, qttools has the designer app which refers to ../../../shared/qttoolbardialog/qttoolbardialog.ui
      preferencesdialog.ui

      When examples are not built, the problem does not trigger because qt_internal_add_app does

      set_property(TARGET "${name}"
                  PROPERTY EXCLUDE_FROM_ALL "$<NOT:$<CONFIG:${QT_MULTI_CONFIG_FIRST_CONFIG}>>")
      

      and the debug variant of the executable is not built.

      But with examples building on, an add_dependencies call between an external project custom target and the designer app target forces a dependency on all variants of the app, including debug.

      Attachments

        Issue Links

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

          Activity

            People

              orkun.tokdemir Orkun Tokdemir
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews