aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--find-modules/FindXCB.cmake20
-rw-r--r--modules/ECMFindModuleHelpers.cmake7
2 files changed, 22 insertions, 5 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}
)
diff --git a/modules/ECMFindModuleHelpers.cmake b/modules/ECMFindModuleHelpers.cmake
index 63cccb93..2044efe1 100644
--- a/modules/ECMFindModuleHelpers.cmake
+++ b/modules/ECMFindModuleHelpers.cmake
@@ -122,7 +122,7 @@ endmacro()
macro(ecm_find_package_parse_components module_name)
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
set(ecm_fppc_oneValueArgs RESULT_VAR)
- set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS)
+ set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
if(ECM_FPPC_UNPARSED_ARGUMENTS)
@@ -134,6 +134,9 @@ macro(ecm_find_package_parse_components module_name)
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
endif()
+ if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
+ set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
+ endif()
if(${module_name}_FIND_COMPONENTS)
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
@@ -178,7 +181,7 @@ macro(ecm_find_package_parse_components module_name)
return()
endif()
else()
- set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_KNOWN_COMPONENTS})
+ set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
endif()
endmacro()