2016-01-18 17:55:33 +03:00
|
|
|
# - Finds Wayland
|
2016-02-25 23:57:56 +03:00
|
|
|
# Find the Wayland libraries that are needed for UWAC
|
2014-10-13 13:43:16 +04:00
|
|
|
#
|
|
|
|
# This module defines the following variables:
|
2016-01-18 17:55:33 +03:00
|
|
|
# WAYLAND_FOUND - true if UWAC has been found
|
|
|
|
# WAYLAND_LIBS - Set to the full path to wayland client libraries
|
|
|
|
# WAYLAND_INCLUDE_DIR - Set to the include directories for wayland
|
|
|
|
# XKBCOMMON_LIBS - Set to the full path to xkbcommon libraries
|
|
|
|
# XKBCOMMON_INCLUDE_DIR - Set to the include directories for xkbcommon
|
2014-10-13 13:43:16 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
#=============================================================================
|
2016-01-07 01:56:05 +03:00
|
|
|
# Copyright 2015 David Fort <contact@hardening-consulting.com>
|
2014-10-13 13:43:16 +04:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#=============================================================================
|
|
|
|
|
2015-01-19 00:23:50 +03:00
|
|
|
include(FindPkgConfig)
|
|
|
|
|
|
|
|
if(PKG_CONFIG_FOUND)
|
2016-02-25 23:57:56 +03:00
|
|
|
pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner)
|
|
|
|
pkg_check_modules(WAYLAND_CLIENT_PC wayland-client)
|
2019-01-25 15:05:51 +03:00
|
|
|
pkg_check_modules(WAYLAND_CURSOR_PC wayland-cursor)
|
2016-02-25 23:57:56 +03:00
|
|
|
pkg_check_modules(XKBCOMMON_PC xkbcommon)
|
2015-01-19 00:23:50 +03:00
|
|
|
endif()
|
2014-10-13 13:43:16 +04:00
|
|
|
|
2016-01-18 17:55:33 +03:00
|
|
|
find_program(WAYLAND_SCANNER wayland-scanner
|
2016-02-25 23:57:56 +03:00
|
|
|
HINTS "${WAYLAND_SCANNER_PC_PREFIX}/bin"
|
2016-01-18 17:55:33 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
find_path(WAYLAND_INCLUDE_DIR wayland-client.h
|
2016-02-25 23:57:56 +03:00
|
|
|
HINTS ${WAYLAND_CLIENT_PC_INCLUDE_DIRS}
|
2016-01-18 17:55:33 +03:00
|
|
|
)
|
|
|
|
|
2019-01-25 15:05:51 +03:00
|
|
|
find_library(WAYLAND_CLIENT_LIB
|
2016-01-18 17:55:33 +03:00
|
|
|
NAMES "wayland-client"
|
2016-02-25 23:57:56 +03:00
|
|
|
HINTS "${WAYLAND_CLIENT_PC_LIBRARY_DIRS}"
|
2016-01-18 17:55:33 +03:00
|
|
|
)
|
|
|
|
|
2019-01-25 15:05:51 +03:00
|
|
|
find_library(WAYLAND_CURSOR_LIB
|
|
|
|
NAMES "wayland-cursor"
|
|
|
|
HINTS "${WAYLAND_CURSOR_PC_LIBRARY_DIRS}"
|
|
|
|
)
|
|
|
|
|
|
|
|
if (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
|
2019-01-28 17:46:12 +03:00
|
|
|
list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB})
|
2019-01-25 15:05:51 +03:00
|
|
|
endif (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
|
|
|
|
|
2016-01-18 17:55:33 +03:00
|
|
|
find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h
|
2016-02-22 18:03:57 +03:00
|
|
|
HINTS ${XKBCOMMON_PC_INCLUDE_DIRS}
|
2016-01-18 17:55:33 +03:00
|
|
|
)
|
|
|
|
|
2016-02-25 23:57:56 +03:00
|
|
|
find_library(XKBCOMMON_LIBS
|
2016-01-18 17:55:33 +03:00
|
|
|
NAMES xkbcommon
|
2016-02-23 11:22:15 +03:00
|
|
|
HINTS "${XKBCOMMON_PC_LIBRARY_DIRS}"
|
2016-01-18 17:55:33 +03:00
|
|
|
)
|
|
|
|
|
2016-01-07 01:56:05 +03:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2016-01-18 17:55:33 +03:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_SCANNER WAYLAND_INCLUDE_DIR WAYLAND_LIBS XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBS)
|