2014-10-13 13:43:16 +04:00
|
|
|
# - Find Wayland
|
|
|
|
# Find the Wayland libraries
|
|
|
|
#
|
|
|
|
# This module defines the following variables:
|
|
|
|
# WAYLAND_FOUND - true if WAYLAND_INCLUDE_DIR & WAYLAND_LIBRARY are found
|
|
|
|
# WAYLAND_LIBRARIES - Set when WAYLAND_LIBRARY is found
|
|
|
|
# WAYLAND_INCLUDE_DIRS - Set when WAYLAND_INCLUDE_DIR is found
|
|
|
|
#
|
|
|
|
# WAYLAND_INCLUDE_DIR - where to find wayland-client.h, etc.
|
|
|
|
# WAYLAND_LIBRARY - the Wayland client library
|
2015-01-19 00:23:50 +03:00
|
|
|
# WAYLAND_VERSION - wayland client version if found and pkg-config was used
|
2014-10-13 13:43:16 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2014 Manuel Bachmann <tarnyko@tarnyko.net>
|
2015-01-19 00:23:50 +03:00
|
|
|
# Copyright 2015 Bernhard Miklautz <bernhard.miklautz@shacknet.at>
|
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-21 14:33:39 +03:00
|
|
|
set(REQUIRED_WAYLAND_CLIENT_VERSION 1.3.0)
|
2015-01-19 00:23:50 +03:00
|
|
|
include(FindPkgConfig)
|
|
|
|
|
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(WAYLAND wayland-client)
|
|
|
|
endif()
|
|
|
|
|
2014-10-13 13:43:16 +04:00
|
|
|
find_path(WAYLAND_INCLUDE_DIR NAMES wayland-client.h
|
2015-01-19 00:23:50 +03:00
|
|
|
PATHS ${WAYLAND_INCLUDE_DIRS}
|
2014-10-13 13:43:16 +04:00
|
|
|
DOC "The Wayland include directory"
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(WAYLAND_LIBRARY NAMES wayland-client
|
2015-01-19 00:23:50 +03:00
|
|
|
PATHS ${WAYLAND_LIBRARY_DIRS}
|
2014-10-13 13:43:16 +04:00
|
|
|
DOC "The Wayland client library"
|
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARY WAYLAND_INCLUDE_DIR)
|
|
|
|
|
2015-01-19 00:23:50 +03:00
|
|
|
if(WAYLAND_VERSION)
|
|
|
|
if (${WAYLAND_VERSION} VERSION_LESS ${REQUIRED_WAYLAND_CLIENT_VERSION})
|
|
|
|
message(WARNING "Installed wayland version ${WAYLAND_VERSION} is too old - minimum required version ${REQUIRED_WAYLAND_CLIENT_VERSION}")
|
|
|
|
set(WAYLAND_FOUND FALSE)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(WARNING "Couldn't detect wayland version - no version check is done")
|
2014-10-13 13:43:16 +04:00
|
|
|
endif()
|
|
|
|
|
2015-01-19 00:23:50 +03:00
|
|
|
if(WAYLAND_FOUND)
|
|
|
|
set(WAYLAND_LIBRARIES ${WAYLAND_LIBRARY})
|
|
|
|
set(WAYLAND_INCLUDE_DIRS ${WAYLAND_INCLUDE_DIR})
|
|
|
|
endif()
|
2014-10-13 13:43:16 +04:00
|
|
|
|
2015-01-19 00:23:50 +03:00
|
|
|
mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY WAYLAND_VERSION)
|