Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
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://testresults.qt.io/coin/integration/qt/qt5/tasks/web_qt_qt5_1667580188137
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
- relates to
-
QTBUG-90820 Build examples as external projects within the main build
- In Progress
Gerrit Reviews
For Gerrit Dashboard: QTBUG-110369 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
455103,3 | WIP: Investigating example EP AUTOUIC NMC issue | dev | qt/qtbase | Status: ABANDONED | -2 | 0 |
455210,2 | CMake: Work around AUTOUIC Ninja Multi-Config issue with EP examples | dev | qt/qtbase | Status: MERGED | +2 | 0 |
455211,2 | CMake: Exclude designer from dependencies when building EP examples | dev | qt/qttools | Status: MERGED | +2 | 0 |
520096,96 | CMake: Add `qt_add_ui` API | dev | qt/qtbase | Status: MERGED | +2 | 0 |
522189,2 | CMake: Work around AUTOUIC Ninja Multi-Config issue with EP examples | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |