From addcfa6dc7f437ccbe098b9ad85fd9e1811a862e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 15 Jun 2022 11:38:48 +0200 Subject: [PATCH] CMake build: Fix issues with sharing qmldesignercore files When adding the .ui files from qmldesignercore.cmake to tst_assetsImport and tst_merge in the qtquickdesigner repository, AUTOUIC for some reason gets the output location for the generated ui_*.h headers from: It puts them into qtquickdesigner/tests/qtcreator/src/plugins/qmldesigner/designercore/ instances/ instead of into the corresponding *_autogen directory. That leads to both tests wanting to generate the same file, and ninja complains with ninja: error: build.ninja:78635: multiple rules generate qtquickdesigner/..... Do not use AUTOUIC for these .ui files, but instead add them manually with qt_wrap_ui. Change-Id: I1d60fae95739335a87f8196ed2a686a0633165b2 Reviewed-by: Cristian Adam Reviewed-by: Qt CI Bot --- src/plugins/qmldesigner/qmldesignercore.cmake | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/qmldesignercore.cmake b/src/plugins/qmldesigner/qmldesignercore.cmake index b904057da2b..46e30173a3b 100644 --- a/src/plugins/qmldesigner/qmldesignercore.cmake +++ b/src/plugins/qmldesigner/qmldesignercore.cmake @@ -49,6 +49,21 @@ function(extend_with_qmldesigner_core target_name) rewritertransaction.h ) + # autouic gets confused when adding the ui files to tests in the qtquickdesigner repo, + # so manually add them for UIC + set(UI_FILES + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/designercore/instances/puppetbuildprogressdialog.ui + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/designercore/instances/puppetdialog.ui + ) + qt_wrap_ui(UI_SOURCES ${UI_FILES}) + extend_qtc_target(${target_name} + INCLUDES ${CMAKE_CURRENT_BINARY_DIR} + SOURCES + ${UI_SOURCES} + ${UI_FILES} + ) + set_source_files_properties(${UI_FILES} PROPERTIES SKIP_AUTOUIC ON) + extend_qtc_target(${target_name} INCLUDES ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/designercore/exceptions @@ -204,12 +219,10 @@ function(extend_with_qmldesigner_core target_name) instances/nodeinstanceview.cpp instances/puppetbuildprogressdialog.cpp instances/puppetbuildprogressdialog.h - instances/puppetbuildprogressdialog.ui instances/puppetcreator.cpp instances/puppetcreator.h instances/puppetdialog.cpp instances/puppetdialog.h - instances/puppetdialog.ui instances/qprocessuniqueptr.h metainfo/itemlibraryinfo.cpp