Commit 52e6ed54 authored by Drew DeVault's avatar Drew DeVault
Browse files

Initial commit

parents
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
*.swp
*.o
*.a
bin/
test/
build/
.lvimrc
wayland-*-protocol.*
#
# (c)2015 KiCad Developers
# (c)2015 Brian Sidebotham <brian.sidebotham@gmail.com>
#
# CMake module to find a2x (part of the asciidoc toolchain).
#
# Variables generated:
#
# A2X_FOUND true when A2X_COMMAND is valid
# A2X_COMMAND The command to run a2x (may be a list including an interpreter)
# A2X_VERSION The a2x version that has been found
#
# Have a go at finding a a2x executable
find_program( A2X_PROGRAM a2x )
# Found something, attempt to try and use it...
if( A2X_PROGRAM )
execute_process(
COMMAND ${A2X_PROGRAM} --version
OUTPUT_VARIABLE _OUT
ERROR_VARIABLE _ERR
RESULT_VARIABLE _RES
OUTPUT_STRIP_TRAILING_WHITESPACE )
# If it worked, set the A2X_COMMAND
if( _RES MATCHES 0 )
set( A2X_COMMAND "${A2X_PROGRAM}" )
endif()
endif()
# If nothing could be found, test to see if we can just find the script file,
# that we'll then run with the python interpreter
if( NOT A2X_COMMAND )
find_file( A2X_SCRIPT a2x.py )
if( A2X_SCRIPT )
# Find the python interpreter quietly
if( NOT PYTHONINTERP_FOUND )
find_package( PYTHONINTERP QUIET )
endif()
if( NOT PYTHONINTERP_FOUND )
# Python's not available so can't find a2x...
set( A2X_COMMAND "" )
else()
# Build the python based command
set( A2X_COMMAND "${PYTHON_EXECUTABLE}" "${A2X_SCRIPT}" )
execute_process(
COMMAND ${A2X_COMMAND} --version
OUTPUT_VARIABLE _OUT
ERROR_VARIABLE _ERR
RESULT_VARIABLE _RES
OUTPUT_STRIP_TRAILING_WHITESPACE )
# If it still can't be run, then give up
if( NOT _RES MATCHES 0 )
set( A2X_COMMAND "" )
endif()
endif()
endif()
endif()
# If we've found a command that works, check the version
if( A2X_COMMAND )
string(REGEX REPLACE ".*a2x[^0-9.]*\([0-9.]+\).*" "\\1" A2X_VERSION "${_OUT}")
endif()
# Generate the *_FOUND as necessary, etc.
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args(
A2X
REQUIRED_VARS A2X_COMMAND
VERSION_VAR A2X_VERSION )
#.rst:
# FindDRM
# -------
#
# Find DRM library
#
# Try to find DRM library on UNIX systems. The following values are defined
#
# ::
#
# DRM_FOUND - True if drm is available
# DRM_INCLUDE_DIRS - Include directories for drm
# DRM_LIBRARIES - List of libraries for drm
# DRM_DEFINITIONS - List of definitions for drm
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(DRM PROPERTIES
URL "http://dri.freedesktop.org/"
DESCRIPTION "Kernel module that gives direct hardware access to DRI clients")
find_package(PkgConfig)
pkg_check_modules(PC_DRM QUIET libdrm)
find_library(DRM_LIBRARIES NAMES drm HINTS ${PC_DRM_LIBRARY_DIRS})
find_path(DRM_INCLUDE_DIRS NAMES drm.h PATH_SUFFIXES libdrm drm HINTS ${PC_DRM_INCLUDE_DIRS})
set(DRM_DEFINITIONS ${PC_DRM_CFLAGS_OTHER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DRM DEFAULT_MSG DRM_INCLUDE_DIRS DRM_LIBRARIES)
mark_as_advanced(DRM_INCLUDE_DIRS DRM_LIBRARIES DRM_DEFINITIONS)
#.rst:
# FindDbus
# -----------
#
# Find Dbus library
#
# Try to find Dbus library on UNIX systems. The following values are defined
#
# ::
#
# DBUS_FOUND - True if dbus is available
# DBUS_INCLUDE_DIRS - Include directories for dbus
# DBUS_LIBRARIES - List of libraries for dbus
# DBUS_DEFINITIONS - List of definitions for dbus
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(Dbus PROPERTIES
URL "http://www.freedesktop.org/wiki/Software/dbus/"
DESCRIPTION "Message bus system")
find_package(PkgConfig)
pkg_check_modules(PC_DBUS QUIET dbus-1)
find_path(DBUS_SYSTEM_INCLUDES dbus/dbus.h PATH_SUFFIXES dbus-1.0)
find_path(DBUS_LIB_INCLUDES dbus/dbus-arch-deps.h HINTS ${PC_DBUS_INCLUDE_DIRS} ${CMAKE_LIBRARY_PATH}/dbus-1.0/include ${CMAKE_SYSTEM_LIBRARY_PATH}/dbus-1.0/include)
find_library(DBUS_LIBRARIES NAMES dbus-1 HINTS ${PC_DBUS_LIBRARY_DIRS})
set(DBUS_INCLUDE_DIRS ${DBUS_SYSTEM_INCLUDES} ${DBUS_LIB_INCLUDES})
set(DBUS_DEFINITIONS ${PC_DBUS_CFLAGS_OTHER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DBUS DEFAULT_MSG DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
mark_as_advanced(DBUS_INCLUDE_DIRS DBUS_LIBRARIES DBUS_SYSTEM_INCLUDES DBUS_LIB_INCLUDES DBUS_DEFINITIONS)
#.rst:
# FindEGL
# -------
#
# Find EGL library
#
# Try to find EGL library. The following values are defined
#
# ::
#
# EGL_FOUND - True if egl is available
# EGL_INCLUDE_DIRS - Include directories for egl
# EGL_LIBRARIES - List of libraries for egl
# EGL_DEFINITIONS - List of definitions for egl
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(EGL PROPERTIES
URL "http://www.khronos.org/egl/"
DESCRIPTION "Native Platform Interface")
find_package(PkgConfig)
pkg_check_modules(PC_EGL QUIET egl)
find_library(EGL_LIBRARIES NAMES egl EGL HINTS ${PC_EGL_LIBRARY_DIRS})
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h HINTS ${PC_EGL_INCLUDE_DIRS})
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARIES EGL_INCLUDE_DIRS)
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES EGL_DEFINITIONS)
#.rst:
# FindGLESv2
# -------
#
# Find GLESv2 library
#
# Try to find GLESv2 library. The following values are defined
#
# ::
#
# GLESv2_FOUND - True if glesv2 is available
# GLESv2_INCLUDE_DIRS - Include directories for glesv2
# GLESv2_LIBRARIES - List of libraries for glesv2
# GLESv2_DEFINITIONS - List of definitions for glesv2
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(GLESv2 PROPERTIES
URL "https://www.khronos.org/opengles/"
DESCRIPTION "The Standard for Embedded Accelerated 3D Graphics")
find_package(PkgConfig)
pkg_check_modules(PC_GLES2 QUIET glesv2)
find_library(GLESv2_LIBRARIES NAMES GLESv2 ${PC_GLES2_LIBRARY_DIRS})
find_path(GLESv2_INCLUDE_DIRS NAMES GLES2/gl2.h HINTS ${PC_GLES2_INCLUDE_DIRS})
set(GLESv2_DEFINITIONS ${PC_GLES2_CFLAGS_OTHER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARIES GLESv2_INCLUDE_DIRS)
mark_as_advanced(GLESv2_INCLUDE_DIRS GLESv2_LIBRARIES GLESv2_DEFINITIONS)
#.rst:
# FindLibInput
# -------
#
# Find LibInput library
#
# Try to find LibInpu library. The following values are defined
#
# ::
#
# LIBINPUT_FOUND - True if libinput is available
# LIBINPUT_INCLUDE_DIRS - Include directories for libinput
# LIBINPUT_LIBRARIES - List of libraries for libinput
# LIBINPUT_DEFINITIONS - List of definitions for libinput
#
# and also the following more fine grained variables
#
# ::
#
# LIBINPUT_VERSION
# LIBINPUT_VERSION_MAJOR
# LIBINPUT_VERSION_MINOR
# LIBINPUT_VERSION_MICRO
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(LibInput PROPERTIES
URL "http://freedesktop.org/wiki/Software/libinput/"
DESCRIPTION "Library to handle input devices")
find_package(PkgConfig)
pkg_check_modules(PC_INPUT QUIET libinput)
find_library(LIBINPUT_LIBRARIES NAMES input HINTS ${PC_INPUT_LIBRARY_DIRS})
find_path(LIBINPUT_INCLUDE_DIRS libinput.h HINTS ${PC_INPUT_INCLUDE_DIRS})
set(LIBINPUT_VERSION ${PC_INPUT_VERSION})
string(REPLACE "." ";" VERSION_LIST "${PC_INPUT_VERSION}")
LIST(LENGTH VERSION_LIST n)
if (n EQUAL 3)
list(GET VERSION_LIST 0 LIBINPUT_VERSION_MAJOR)
list(GET VERSION_LIST 1 LIBINPUT_VERSION_MINOR)
list(GET VERSION_LIST 2 LIBINPUT_VERSION_MICRO)
else ()
set(LIBINPUT_VERSION "9999.9999.9999")
set(LIBINPUT_VERSION_MAJOR 9999)
set(LIBINPUT_VERSION_MINOR 9999)
set(LIBINPUT_VERSION_MICRO 9999)
message(WARNING "Could not detect libinput version, assuming you have recent one")
endif ()
# This is compatible with libinput-version.h that exists in upstream
# but isn't in distribution (probably forgotten)
set(LIBINPUT_DEFINITIONS ${PC_INPUT_CFLAGS_OTHER}
-DLIBINPUT_VERSION=\"${LIBINPUT_VERSION}\"
-DLIBINPUT_VERSION_MAJOR=${LIBINPUT_VERSION_MAJOR}
-DLIBINPUT_VERSION_MINOR=${LIBINPUT_VERSION_MINOR}
-DLIBINPUT_VERSION_MICRO=${LIBINPUT_VERSION_MICRO})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBINPUT DEFAULT_MSG LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES)
mark_as_advanced(LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES LIBINPUT_DEFINITIONS
LIBINPUT_VERSION LIBINPUT_VERSION_MAJOR LIBINPUT_VERSION_MICRO LIBINPUT_VERSION_MINOR)
#.rst:
# FindUdev
# -------
#
# Find udev library
#
# Try to find udev library on UNIX systems. The following values are defined
#
# ::
#
# UDEV_FOUND - True if udev is available
# UDEV_INCLUDE_DIRS - Include directories for udev
# UDEV_LIBRARIES - List of libraries for udev
# UDEV_DEFINITIONS - List of definitions for udev
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(Udev PROPERTIES
URL "https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
DESCRIPTION "Device manager for the Linux kernel")
find_package(PkgConfig)
pkg_check_modules(PC_UDEV QUIET libudev)
find_library(UDEV_LIBRARIES NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS})
find_path(UDEV_INCLUDE_DIRS libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS})
set(UDEV_DEFINITIONS ${PC_UDEV_CFLAGS_OTHER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UDEV DEFAULT_MSG UDEV_INCLUDE_DIRS UDEV_LIBRARIES)
mark_as_advanced(UDEV_INCLUDE_DIRS UDEV_LIBRARIES UDEV_DEFINITIONS)
#.rst:
# FindWayland
# -----------
#
# Find Wayland installation
#
# Try to find Wayland. The following values are defined
#
# ::
#
# WAYLAND_FOUND - True if Wayland is found
# WAYLAND_LIBRARIES - Link these to use Wayland
# WAYLAND_INCLUDE_DIRS - Include directories for Wayland
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
#
# and also the following more fine grained variables:
#
# ::
#
# WAYLAND_CLIENT_FOUND, WAYLAND_CLIENT_INCLUDE_DIRS, WAYLAND_CLIENT_LIBRARIES
# WAYLAND_SERVER_FOUND, WAYLAND_SERVER_INCLUDE_DIRS, WAYLAND_SERVER_LIBRARIES
# WAYLAND_EGL_FOUND, WAYLAND_EGL_INCLUDE_DIRS, WAYLAND_EGL_LIBRARIES
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
# 2013 Martin Gräßlin <mgraesslin@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(Wayland PROPERTIES
URL "http://wayland.freedesktop.org/"
DESCRIPTION "Protocol for implementing compositors")
find_package(PkgConfig)
pkg_check_modules(PC_WAYLAND QUIET wayland-client>=1.7 wayland-server>=1.7 wayland-egl)
find_library(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PC_WAYLAND_LIBRARY_DIRS})
find_library(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PC_WAYLAND_LIBRARY_DIRS})
find_library(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PC_WAYLAND_LIBRARY_DIRS})
find_path(WAYLAND_CLIENT_INCLUDE_DIRS NAMES wayland-client.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
find_path(WAYLAND_SERVER_INCLUDE_DIRS NAMES wayland-server.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
find_path(WAYLAND_EGL_INCLUDE_DIRS NAMES wayland-egl.h HINTS ${PC_WAYLAND_INCLUDE_DIRS})
set(WAYLAND_INCLUDE_DIRS ${WAYLAND_CLIENT_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ${WAYLAND_EGL_INCLUDE_DIRS})
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES})
set(WAYLAND_DEFINITIONS ${PC_WAYLAND_CFLAGS})
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIRS)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIRS)
find_package_handle_standard_args(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIRS)
find_package_handle_standard_args(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIRS)
find_package_handle_standard_args(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIRS)
mark_as_advanced(
WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES
WAYLAND_CLIENT_INCLUDE_DIRS WAYLAND_CLIENT_LIBRARIES
WAYLAND_SERVER_INCLUDE_DIRS WAYLAND_SERVER_LIBRARIES
WAYLAND_EGL_INCLUDE_DIRS WAYLAND_EGL_LIBRARIES
WAYLAND_DEFINITIONS
)
#.rst:
# FindWaylandProtocols
# -------
#
# Find wayland protocol description files
#
# Try to find wayland protocol files. The following values are defined
#
# ::
#
# WAYLANDPROTOCOLS_FOUND - True if wayland protocol files are available
# WAYLANDPROTOCOLS_PATH - Path to wayland protocol files
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
include(FeatureSummary)
set_package_properties(WaylandProtocols PROPERTIES
URL "https://cgit.freedesktop.org/wayland/wayland-protocols"
DESCRIPTION "Wayland protocol development")
unset(WAYLANDPROTOCOLS_PATH)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
OUTPUT_VARIABLE WAYLANDPROTOCOLS_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WaylandProtocols DEFAULT_MSG WAYLANDPROTOCOLS_PATH)
mark_as_advanced(WAYLANDPROTOCOLS_PATH)
find_package(A2X REQUIRED)
add_custom_target(man ALL)
function(add_manpage name section)
add_custom_command(
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
COMMAND ${A2X_COMMAND}
--no-xmllint
--doctype manpage
--format manpage
-D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
COMMENT Generating manpage for ${name}.${section}
)
add_custom_target(man-${name}.${section}
DEPENDS
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
)
add_dependencies(man
man-${name}.${section}
)
install(
FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/man/man${section}
COMPONENT documentation
)
endfunction()
#=============================================================================
# Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Pier Luigi Fiorini nor the names of his
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
# wayland_add_protocol_client(outfiles inputfile basename)
function(WAYLAND_ADD_PROTOCOL_CLIENT _sources _protocol _basename)
if(NOT WAYLAND_SCANNER_EXECUTABLE)
message(FATAL "The wayland-scanner executable has not been found on your system. You must install it.")
endif()
get_filename_component(_infile ${_protocol} ABSOLUTE)
set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-client-protocol.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c")
add_custom_command(OUTPUT "${_client_header}"
COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header < ${_infile} > ${_client_header}
DEPENDS ${_infile} VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code}
DEPENDS ${_infile} VERBATIM)
list(APPEND ${_sources} "${_client_header}" "${_code}")
set(${_sources} ${${_sources}} PARENT_SCOPE)
endfunction()
# wayland_add_protocol_server(outfiles inputfile basename)
function(WAYLAND_ADD_PROTOCOL_SERVER _sources _protocol _basename)
if(NOT WAYLAND_SCANNER_EXECUTABLE)
message(FATAL "The wayland-scanner executable has not been found on your system. You must install it.")
endif()
get_filename_component(_infile ${_protocol} ABSOLUTE)
set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-server-protocol.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c")
add_custom_command(OUTPUT "${_server_header}"
COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header < ${_infile} > ${_server_header}
DEPENDS ${_infile} VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code}
DEPENDS ${_infile} VERBATIM)
list(APPEND ${_sources} "${_server_header}" "${_code}")
set(${_sources} ${${_sources}} PARENT_SCOPE)
endfunction()
cmake_minimum_required(VERSION 3.1.0)
project(wlroots C)
if (CMAKE_BUILD_TYPE EQUAL "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
endif()
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
if (CMAKE_COMPILER_IS_GNUCC)
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-fallthrough=0")
endif()
endif()
list(INSERT CMAKE_MODULE_PATH 0
${CMAKE_CURRENT_SOURCE_DIR}/CMake
)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()