From 7d6915b482820e53c46b3a68ac27d2ef8485a248 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Tue, 3 Nov 2015 18:32:12 +0000 Subject: Do not find XCB's XINPUT library by default. The XINPUT library is unlikely to be available on many systems, including a lot of Linux distributions. This will warn developers in advance by (a) not searching for XINPUT unless it was explicitly requested, and (b) printing a warning if they do request it. REVIEW: 125935 --- find-modules/FindXCB.cmake | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'find-modules/FindXCB.cmake') diff --git a/find-modules/FindXCB.cmake b/find-modules/FindXCB.cmake index b2a800f7..d530d2d7 100644 --- a/find-modules/FindXCB.cmake +++ b/find-modules/FindXCB.cmake @@ -18,7 +18,8 @@ # XKB XPRINT XTEST XV XVMC # # If no components are specified, this module will act as though all components -# were passed to OPTIONAL_COMPONENTS. +# except XINPUT (which is considered unstable) were passed to +# OPTIONAL_COMPONENTS. # # This module will define the following variables, independently of the # components searched for or found: @@ -57,7 +58,7 @@ #============================================================================= # Copyright 2011 Fredrik Höglund # Copyright 2013 Martin Gräßlin -# Copyright 2014 Alex Merry +# Copyright 2014-2015 Alex Merry # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -125,7 +126,13 @@ set(XCB_known_components XPRINT XTEST XV - XVMC) + XVMC +) + +# XINPUT is unstable; do not include it by default +set(XCB_default_components ${XCB_known_components}) +list(REMOVE_ITEM XCB_default_components "XINPUT") + # default component info: xcb components have fairly predictable # header files, library names and pkg-config names foreach(_comp ${XCB_known_components}) @@ -165,7 +172,14 @@ set(XCB_UTIL_header "xcb/xcb_util.h") ecm_find_package_parse_components(XCB RESULT_VAR XCB_components KNOWN_COMPONENTS ${XCB_known_components} + DEFAULT_COMPONENTS ${XCB_default_components} ) + +list(FIND XCB_components "XINPUT" _XCB_XINPUT_index) +if (NOT _XCB_XINPUT_index EQUAL -1) + message(AUTHOR_WARNING "XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems!") +endif() + ecm_find_package_handle_library_components(XCB COMPONENTS ${XCB_components} ) -- cgit v1.2.1