aboutsummaryrefslogtreecommitdiff
path: root/find-modules/FindXCB.cmake
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-11-03 18:32:12 +0000
committerAlex Merry <alex.merry@kde.org>2015-11-17 21:23:27 +0000
commit7d6915b482820e53c46b3a68ac27d2ef8485a248 (patch)
tree58a78a70b1232e7716569d07503d08e30d7435db /find-modules/FindXCB.cmake
parent208ad2b3c1959a70bc9a7b738e89ad3ee4ae2446 (diff)
downloadextra-cmake-modules-7d6915b482820e53c46b3a68ac27d2ef8485a248.tar.gz
extra-cmake-modules-7d6915b482820e53c46b3a68ac27d2ef8485a248.tar.bz2
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
Diffstat (limited to 'find-modules/FindXCB.cmake')
-rw-r--r--find-modules/FindXCB.cmake20
1 files changed, 17 insertions, 3 deletions
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 <fredrik@kde.org>
# Copyright 2013 Martin Gräßlin <mgraesslin@kde.org>
-# Copyright 2014 Alex Merry <alex.merry@kde.org>
+# Copyright 2014-2015 Alex Merry <alex.merry@kde.org>
#
# 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}
)