Merge pull request #23092 from webosbrew/feature/webOS
[xbmc.git] / cmake / modules / FindWaylandProtocolsWebOS.cmake
blob979c34d6602fa518342d629b02bd28c7fb62519f
1 # FindWaylandProtocolsWebOS
2 # -------------------------
3 # Find wayland-protocol-webOS
5 # This will define the following variables::
7 # WAYLANDPROTOCOLSWEBOS_FOUND        -  systm has wayland-webos-client
8 # WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR -  directory containing the additional webOS Wayland protocols
9 #                                       from the webos-wayland-extensions package
10 if(PKG_CONFIG_FOUND)
11   pkg_check_modules(PC_WAYLAND_WEBOS_CLIENT wayland-webos-client>=1.0.0)
12 endif()
14 find_path(WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR NAMES wayland-webos/webos-shell.xml
15                                               PATHS ${DEPENDS_PATH}/share)
17 include(FindPackageHandleStandardArgs)
18 find_package_handle_standard_args(WaylandProtocolsWebOS
19                                   REQUIRED_VARS WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR
20                                   VERSION_VAR WAYLAND_WEBOS_SERVER_VERSION)
22 if(WAYLANDPROTOCOLSWEBOS_FOUND)
23   # Promote to cache variables so all code can access it
24   set(WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR "${WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR}/wayland-webos" CACHE INTERNAL "")
25 endif()
27 mark_as_advanced(WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR)