summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-09-09 18:43:40 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-09-11 09:54:57 +0200
commit2c947898545013557ef26218e15e5dfc3566a712 (patch)
treef089bda6bc9cb6e8e346ce232669c818ba0c1d6c
parent7d1debe004cbf3e0a1561dd234fbedab9b2ab3f9 (diff)
downloadqtwayland-2c947898545013557ef26218e15e5dfc3566a712.tar.gz
CMake: Add checks that the wayland scanner targets are found
There was an issue when cross-compiling Qt tools with Yocto, that the dependency between QtWaylandScannerTools and WaylandScanner was not registered, leading to failures at build time, try to run an executable called "Wayland::Scanner". Explicitly check that the targets exist, and fail at configure time in case they don't exist. Task-number: QTBUG-83968 Change-Id: I19ece78b77619761394d047f15cd3a7a37fb0cbf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/client/Qt6WaylandClientMacros.cmake8
-rw-r--r--src/compositor/Qt6WaylandCompositorMacros.cmake8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/client/Qt6WaylandClientMacros.cmake
index 7b103fd6..eb566f63 100644
--- a/src/client/Qt6WaylandClientMacros.cmake
+++ b/src/client/Qt6WaylandClientMacros.cmake
@@ -2,6 +2,14 @@ function(qt6_generate_wayland_protocol_client_sources target)
qt_parse_all_arguments(arg "qt6_generate_wayland_protocol_client_sources" "" "" "FILES" ${ARGN})
get_target_property(target_binary_dir ${target} BINARY_DIR)
+ if(NOT TARGET Wayland::Scanner)
+ message(FATAL_ERROR "Wayland::Scanner target not found. You might be missing the WaylandScanner CMake package.")
+ endif()
+
+ if(NOT TARGET Qt6::qtwaylandscanner)
+ message(FATAL_ERROR "qtwaylandscanner executable not found. Most likely there is an issue with your Qt installation.")
+ endif()
+
foreach(protocol_file IN LISTS arg_FILES)
get_filename_component(protocol_name "${protocol_file}" NAME_WLE)
diff --git a/src/compositor/Qt6WaylandCompositorMacros.cmake b/src/compositor/Qt6WaylandCompositorMacros.cmake
index 51e76b4d..0350efdd 100644
--- a/src/compositor/Qt6WaylandCompositorMacros.cmake
+++ b/src/compositor/Qt6WaylandCompositorMacros.cmake
@@ -2,6 +2,14 @@ function(qt6_generate_wayland_protocol_server_sources target)
qt_parse_all_arguments(arg "qt6_generate_wayland_protocol_server_sources" "" "" "FILES" ${ARGN})
get_target_property(target_binary_dir ${target} BINARY_DIR)
+ if(NOT TARGET Wayland::Scanner)
+ message(FATAL_ERROR "Wayland::Scanner target not found. You might be missing the WaylandScanner CMake package.")
+ endif()
+
+ if(NOT TARGET Qt6::qtwaylandscanner)
+ message(FATAL_ERROR "qtwaylandscanner executable not found. Most likely there is an issue with your Qt installation.")
+ endif()
+
foreach(protocol_file IN LISTS arg_FILES)
get_filename_component(protocol_name "${protocol_file}" NAME_WLE)