summaryrefslogtreecommitdiff
path: root/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-23 13:38:27 -0500
committersanine <sanine.not@pm.me>2022-08-23 13:38:27 -0500
commit3afbf2a13b2dada445fb667bf25600407fea480a (patch)
tree551329e6f74fc9f177616de0d6739e8b5331ae96 /libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake
parent261e3f991221fbad6bbf262f5e65b773e4b6c73e (diff)
parent25ed7eb9f84e9a822f698ad803901fbb2a5354cf (diff)
:wMerge branch 'gl-window' into main
Diffstat (limited to 'libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake')
-rw-r--r--libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake b/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake
new file mode 100644
index 0000000..8eb83f2
--- /dev/null
+++ b/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake
@@ -0,0 +1,26 @@
+find_package(PkgConfig)
+
+pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION})
+
+execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
+ OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR
+ RESULT_VARIABLE _pkgconfig_failed)
+if (_pkgconfig_failed)
+ message(FATAL_ERROR "Missing wayland-protocols pkgdatadir")
+endif()
+
+string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}")
+
+find_package_handle_standard_args(WaylandProtocols
+ FOUND_VAR
+ WaylandProtocols_FOUND
+ REQUIRED_VARS
+ WaylandProtocols_PKGDATADIR
+ VERSION_VAR
+ WaylandProtocols_VERSION
+ HANDLE_COMPONENTS
+)
+
+set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND})
+set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR})
+set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION})