From 84da909b478923a95bf26963f24ebd7354f9664e Mon Sep 17 00:00:00 2001 From: patrick96 Date: Mon, 21 Dec 2020 21:17:36 +0100 Subject: [PATCH] Fix FindXcb not doing version checks for components Version checks for FindXcb only make sense if all components have the same version or only a single component is specified --- cmake/modules/FindXcb.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/modules/FindXcb.cmake b/cmake/modules/FindXcb.cmake index 04e5e7d6..1679c309 100644 --- a/cmake/modules/FindXcb.cmake +++ b/cmake/modules/FindXcb.cmake @@ -26,6 +26,13 @@ foreach(_comp ${Xcb_FIND_COMPONENTS}) message(FATAL_ERROR "Unknow component \"${_comp}\" of XCB") endif() + # Forward the different find options set for FindXcb to the individual + # components. This is required because find_package_handle_standard_args in + # find_package_impl uses these variables for version checks and other things. + set(Xcb_${_comp}_FIND_VERSION ${Xcb_FIND_VERSION}) + set(Xcb_${_comp}_FIND_QUIETLY ${Xcb_FIND_QUIETLY}) + set(Xcb_${_comp}_FIND_REQUIRED ${Xcb_FIND_REQUIRED}) + # Bypass developer warning that the first argument to # find_package_handle_standard_args (Xcb_...) does not match the name of the # calling package (Xcb)