2 # Find the Wayland libraries that are needed for UWAC
4 # This module defines the following variables:
5 # WAYLAND_FOUND - true if UWAC has been found
6 # WAYLAND_LIBS - Set to the full path to wayland client libraries
7 # WAYLAND_INCLUDE_DIR - Set to the include directories for wayland
8 # XKBCOMMON_LIBS - Set to the full path to xkbcommon libraries
9 # XKBCOMMON_INCLUDE_DIR - Set to the include directories for xkbcommon
12 #=============================================================================
13 # Copyright 2015 David Fort <contact@hardening-consulting.com>
15 # Licensed under the Apache License, Version 2.0 (the "License");
16 # you may not use this file except in compliance with the License.
17 # You may obtain a copy of the License at
19 # http://www.apache.org/licenses/LICENSE-2.0
21 # Unless required by applicable law or agreed to in writing, software
22 # distributed under the License is distributed on an "AS IS" BASIS,
23 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 # See the License for the specific language governing permissions and
25 # limitations under the License.
26 #=============================================================================
28 include(FindPkgConfig)
31 pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner)
32 pkg_check_modules(WAYLAND_CLIENT_PC wayland-client)
33 pkg_check_modules(WAYLAND_CURSOR_PC wayland-cursor)
34 pkg_check_modules(XKBCOMMON_PC xkbcommon)
37 find_program(WAYLAND_SCANNER wayland-scanner
38 HINTS "${WAYLAND_SCANNER_PC_PREFIX}/bin"
41 find_path(WAYLAND_INCLUDE_DIR wayland-client.h
42 HINTS ${WAYLAND_CLIENT_PC_INCLUDE_DIRS}
45 find_library(WAYLAND_CLIENT_LIB
46 NAMES "wayland-client"
47 HINTS "${WAYLAND_CLIENT_PC_LIBRARY_DIRS}"
50 find_library(WAYLAND_CURSOR_LIB
51 NAMES "wayland-cursor"
52 HINTS "${WAYLAND_CURSOR_PC_LIBRARY_DIRS}"
55 if (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
56 list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB})
57 endif (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
59 find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h
60 HINTS ${XKBCOMMON_PC_INCLUDE_DIRS}
63 find_library(XKBCOMMON_LIBS
65 HINTS "${XKBCOMMON_PC_LIBRARY_DIRS}"
68 include(FindPackageHandleStandardArgs)
69 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_SCANNER WAYLAND_INCLUDE_DIR WAYLAND_LIBS XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBS)