diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | cmake/Functions.cmake | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a3ff75cb..b5fdebc0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,11 @@ externalproject_add(libs COMMAND ${CMAKE_COMMAND} -E remove_directory ../mkspecs ) +# required for topLevel build +add_implicit_dependencies(libs Core Gui Widgets Network OpenGL + OpenGLWidgets Quick QuickWidgets Qml PrintSupport WebChannel Positioning +) + # Ensure the libs project is reconfigured if the root project is reconfigured, so that the # correct CMake and qmake support files are used when building examples, rather than # using the incomplete support files created by the root project. diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 6a8aa69cc..64f43117b 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -16,6 +16,18 @@ function(assertTargets errorResult supportResult) endif() endfunction() +function(add_implicit_dependencies target) + if(TARGET ${target}) + list(REMOVE_ITEM ARGN ${target}) + foreach(qtTarget IN ITEMS ${ARGN}) + if(TARGET Qt::${qtTarget}) + add_dependencies(${target} Qt::${qtTarget}) + endif() + endforeach() + endif() +endfunction() + + # TODO: this should be idealy in qtbase function(add_check_for_support errorResult supportResult) if(NOT DEFINED ${supportResult}) |