From 5fad16ac553dd6e80939a64db6ab655e55292aeb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 15 Nov 2019 17:53:14 +0100 Subject: Fix qtwaylandscanner package dependencies Use the new API provided in qtbase, to register a package dependency between the client module and the QtWaylandScannerTools package. Do the same for the compositor module. Also register a dependency between the QtWaylandScannerTools package and the WaylandScanner package. Also fix the tests condition to check the correct _FOUND variable. Change-Id: Id961a365715cef2d7d0b8a54ca9000dc3890ffd7 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- src/client/CMakeLists.txt | 4 ++++ src/compositor/CMakeLists.txt | 3 +++ src/qtwaylandscanner/CMakeLists.txt | 8 +++++++- tests/CMakeLists.txt | 7 ++----- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 248f72136..597321a2c 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -146,3 +146,7 @@ qt_extend_target(WaylandClient CONDITION QT_FEATURE_draganddrop SOURCES qwaylanddnd.cpp qwaylanddnd_p.h ) + +# special case begin +qt_record_extra_qt_package_dependency(WaylandClient WaylandScannerTools "") +# special case end diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt index 79095147f..6dea4ad9b 100644 --- a/src/compositor/CMakeLists.txt +++ b/src/compositor/CMakeLists.txt @@ -216,3 +216,6 @@ qt_add_docs(WaylandCompositor doc/qtwaylandcompositor.qdocconf ) +# special case begin +qt_record_extra_qt_package_dependency(WaylandCompositor WaylandScannerTools "") +# special case end diff --git a/src/qtwaylandscanner/CMakeLists.txt b/src/qtwaylandscanner/CMakeLists.txt index 107702c31..17254afc3 100644 --- a/src/qtwaylandscanner/CMakeLists.txt +++ b/src/qtwaylandscanner/CMakeLists.txt @@ -5,7 +5,7 @@ ##################################################################### qt_add_tool(qtwaylandscanner - TOOLS_TARGET QtWaylandScanner # special case + TOOLS_TARGET WaylandScanner # special case SOURCES qtwaylandscanner.cpp PUBLIC_LIBRARIES @@ -14,3 +14,9 @@ qt_add_tool(qtwaylandscanner #### Keys ignored in scope 1:.:.:qtwaylandscanner.pro:: # _OPTION = "host_build" + +# special case begin +# Abuse the function to make sure the package providing qtwaylandscanner calls +# find_package(WaylandScanner), aka the non-qt provided package. +qt_record_extra_package_dependency(qtwaylandscanner WaylandScanner "") +# special case end diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index abc3f851f..ce2e25819 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,18 +5,15 @@ if(QT_BUILD_STANDALONE_TESTS) # Add qt_find_package calls for extra dependencies that need to be found when building # the standalone tests here. # special case begin - qt_find_package(Qt6 ${PROJECT_VERSION} OPTIONAL_COMPONENTS WaylandCompositor WaylandClient QtWaylandScannerTools) + qt_find_package(Qt6 ${PROJECT_VERSION} OPTIONAL_COMPONENTS WaylandCompositor WaylandClient) - if (NOT Qt6QtWaylandScannerTools_FOUND) + if (NOT Qt6WaylandScannerTools_FOUND) message(WARNING "QtWaylandTests is missing required components, nothing will be built. \ Although this could be considered an error, the configuration will still pass as coin (Qt's \ continuous integration system) will fail the build if configure fails, but will still try to \ configure the module on targets that are missing dependencies.") return() endif() - - # TODO: Why do we need this? shouldn't find_package for QtWaylandScannerTools be enough? - qt_find_package(WaylandScanner PROVIDED_TARGETS Wayland::Scanner) # special case end endif() qt_build_tests() -- cgit v1.2.3