summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-09 17:14:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-09 17:14:16 (GMT)
commit4802b27e64db507a36c73cdabd7fd2ef01fda228 (patch)
tree7a332af4d1b895a8e45454e4797582da514afcc7
parent85a82a3dee0bf92eaa51f5b6e64a68840153438e (diff)
parent364798fa6b87be4add346036ac68e47cad3bfd14 (diff)
downloadCMake-4802b27e64db507a36c73cdabd7fd2ef01fda228.zip
CMake-4802b27e64db507a36c73cdabd7fd2ef01fda228.tar.gz
CMake-4802b27e64db507a36c73cdabd7fd2ef01fda228.tar.bz2
Merge topic 'FindX11--xcb-randr'
364798fa6b FindX11: Add xcb_randr library Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7046
-rw-r--r--Modules/FindX11.cmake19
-rw-r--r--Tests/FindX11/Test/CMakeLists.txt2
-rw-r--r--Tests/FindX11/Test/main.c17
3 files changed, 38 insertions, 0 deletions
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index fd5ee53..5a9d2a0 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -31,6 +31,7 @@ and also the following more fine grained variables and targets:
X11_xcb_INCLUDE_PATH, X11_xcb_LIB, X11_xcb_FOUND, X11::xcb
X11_X11_xcb_INCLUDE_PATH, X11_X11_xcb_LIB, X11_X11_xcb_FOUND, X11::X11_xcb
X11_xcb_icccm_INCLUDE_PATH, X11_xcb_icccm_LIB, X11_xcb_icccm_FOUND, X11::xcb_icccm
+ X11_xcb_randr_INCLUDE_PATH, X11_xcb_randr_LIB, X11_xcb_randr_FOUND, X11::xcb_randr
X11_xcb_util_INCLUDE_PATH, X11_xcb_util_LIB, X11_xcb_util_FOUND, X11::xcb_util
X11_xcb_xfixes_INCLUDE_PATH, X11_xcb_xfixes_LIB, X11_xcb_xfixes_FOUND, X11::xcb_xfixes
X11_xcb_xkb_INCLUDE_PATH, X11_xcb_xkb_LIB, X11_xcb_xkb_FOUND, X11::xcb_xkb
@@ -82,6 +83,9 @@ and also the following more fine grained variables and targets:
.. versionadded:: 3.19
Added the ``Xaw``, ``xcb_util``, and ``xcb_xfixes`` libraries.
+.. versionadded:: 3.24
+ Added the ``xcb_randr`` library.
+
#]=======================================================================]
if (UNIX)
@@ -127,6 +131,7 @@ if (UNIX)
find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xcb_randr_INCLUDE_PATH xcb/randr.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_util_INCLUDE_PATH xcb/xcb_aux.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_xfixes_INCLUDE_PATH xcb/xfixes.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
@@ -180,6 +185,7 @@ if (UNIX)
find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xcb_randr_LIB xcb-randr ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_util_LIB xcb-util ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_xfixes_LIB xcb-xfixes ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_xkb_LIB xcb-xkb ${X11_LIB_SEARCH_PATH})
@@ -281,6 +287,10 @@ if (UNIX)
set(X11_xcb_icccm_FOUND TRUE)
endif ()
+ if (X11_xcb_randr_LIB AND X11_xcb_randr_INCLUDE_PATH)
+ set(X11_xcb_randr_FOUND TRUE)
+ endif ()
+
if (X11_xcb_util_LIB AND X11_xcb_util_INCLUDE_PATH)
set(X11_xcb_util_FOUND TRUE)
endif ()
@@ -600,6 +610,13 @@ if (UNIX)
INTERFACE_LINK_LIBRARIES "X11::xcb")
endif ()
+ if (X11_xcb_randr_FOUND AND NOT TARGET X11::xcb_randr)
+ add_library(X11::xcb_randr UNKNOWN IMPORTED)
+ set_target_properties(X11::xcb_randr PROPERTIES
+ IMPORTED_LOCATION "${X11_xcb_randr_LIB}"
+ INTERFACE_LINK_LIBRARIES "X11::xcb")
+ endif ()
+
if (X11_xcb_util_FOUND AND NOT TARGET X11::xcb_util)
add_library(X11::xcb_util UNKNOWN IMPORTED)
set_target_properties(X11::xcb_util PROPERTIES
@@ -830,6 +847,8 @@ if (UNIX)
X11_xcb_INCLUDE_PATH
X11_xcb_icccm_LIB
X11_xcb_icccm_INCLUDE_PATH
+ X11_xcb_randr_LIB
+ X11_xcb_randr_INCLUDE_PATH
X11_xcb_util_LIB
X11_xcb_util_INCLUDE_PATH
X11_xcb_xfixes_LIB
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt
index 5b304d9..ddee835 100644
--- a/Tests/FindX11/Test/CMakeLists.txt
+++ b/Tests/FindX11/Test/CMakeLists.txt
@@ -33,6 +33,7 @@ test_x11_component(x11_components Xaw)
test_x11_component(x11_components xcb)
test_x11_component(x11_components X11_xcb)
test_x11_component(x11_components xcb_icccm)
+test_x11_component(x11_components xcb_randr)
test_x11_component(x11_components xcb_util)
test_x11_component(x11_components xcb_xfixes)
test_x11_component(x11_components xcb_xkb)
@@ -74,6 +75,7 @@ foreach(lib
xcb
X11_xcb
xcb_icccm
+ xcb_randr
xcb_util
xcb_xfixes
Xcomposite
diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c
index b44ae28..ce6f224 100644
--- a/Tests/FindX11/Test/main.c
+++ b/Tests/FindX11/Test/main.c
@@ -336,6 +336,20 @@ static void test_xcb(void)
xcb_disconnect(connection);
}
+# ifdef HAVE_xcb_randr
+# include <xcb/randr.h>
+
+static void test_xcb_randr(void)
+{
+ int screen_nbr;
+ xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr);
+ xcb_randr_query_version_cookie_t cookie =
+ xcb_randr_query_version(connection, 0, 0);
+ xcb_disconnect(connection);
+}
+
+# endif
+
# ifdef HAVE_xcb_util
# include <xcb/xcb_aux.h>
@@ -455,6 +469,9 @@ int main(int argc, char* argv[])
test_xcb,
#endif
#ifdef HAVE_xcb_util
+ test_xcb_randr,
+#endif
+#ifdef HAVE_xcb_util
test_xcb_util,
#endif
#ifdef HAVE_xcb_xfixes