summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindWaylandProtocols.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindWaylandProtocols.cmake
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindWaylandProtocols.cmake')
-rw-r--r--cmake/modules/FindWaylandProtocols.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/modules/FindWaylandProtocols.cmake b/cmake/modules/FindWaylandProtocols.cmake
new file mode 100644
index 0000000..e74bb80
--- /dev/null
+++ b/cmake/modules/FindWaylandProtocols.cmake
@@ -0,0 +1,24 @@
+# FindWaylandProtocols
+# --------------------
+# Find wayland-protocols
+#
+# This will define the following variables::
+#
+# WAYLAND_PROTOCOLS_DIR - directory containing the additional Wayland protocols
+# from the wayland-protocols package
+
+pkg_check_modules(PC_WAYLAND_PROTOCOLS wayland-protocols)
+if(PC_WAYLAND_PROTOCOLS_FOUND)
+ pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
+endif()
+
+# Promote to cache variables so all code can access it
+set(WAYLAND_PROTOCOLS_DIR ${WAYLAND_PROTOCOLS_DIR} CACHE INTERNAL "")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(WaylandProtocols
+ REQUIRED_VARS
+ PC_WAYLAND_PROTOCOLS_FOUND
+ WAYLAND_PROTOCOLS_DIR
+ VERSION_VAR
+ PC_WAYLAND_PROTOCOLS_VERSION)