summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-09-20 14:18:17 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-09-20 13:52:00 +0000
commitd8647910bc93eca06491b719105b2228c50cc556 (patch)
treed156f36bbb1b567e4bef0cbb48852870116a0fd0 /cmake
parentbe3287d779d6c97d321b908e2f078baec04cc999 (diff)
cmake: Init uic only if Qt::Widgets is a target
Otherwise we get errors like the following in non-gui projects: Error evaluating generator expression: $<TARGET_FILE:Qt6::uic> No target "Qt6::uic" Change-Id: I8a3a6f8ec5e5c1c3d1f73369c5739a321c64bfbb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index a898d118c6..e8002b5550 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -175,7 +175,10 @@ macro(qt_examples_build_end)
get_all_targets(targets "${CMAKE_CURRENT_SOURCE_DIR}")
foreach(target ${targets})
- qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "moc" "uic" "rcc")
+ qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "moc" "rcc")
+ if(TARGET Qt::Widgets)
+ qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "uic")
+ endif()
endforeach()
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE})