diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-12 08:17:52 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-12 08:17:52 -0500 |
commit | aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa (patch) | |
tree | 62968b4f9a22d275965605cba155afbb69892ee0 /CMake/Wayland.cmake | |
parent | Fix gaps for views being incorrect (diff) | |
download | sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.tar.gz sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.tar.zst sway-aadcba4b7cfa9ce3096fd166a046b151fd5ba8fa.zip |
Add new dependencies for wayland clients
Cairo for rendering shit, Pango for text rendering, and wayland client
stuff. Thanks @Cloudef, blatantly ripping off his cmake files for this
Diffstat (limited to 'CMake/Wayland.cmake')
-rw-r--r-- | CMake/Wayland.cmake | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/CMake/Wayland.cmake b/CMake/Wayland.cmake new file mode 100644 index 00000000..42f97b3b --- /dev/null +++ b/CMake/Wayland.cmake | |||
@@ -0,0 +1,77 @@ | |||
1 | #============================================================================= | ||
2 | # Copyright (C) 2012-2013 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | ||
3 | # All rights reserved. | ||
4 | # | ||
5 | # Redistribution and use in source and binary forms, with or without | ||
6 | # modification, are permitted provided that the following conditions | ||
7 | # are met: | ||
8 | # | ||
9 | # * Redistributions of source code must retain the above copyright | ||
10 | # notice, this list of conditions and the following disclaimer. | ||
11 | # | ||
12 | # * Redistributions in binary form must reproduce the above copyright | ||
13 | # notice, this list of conditions and the following disclaimer in the | ||
14 | # documentation and/or other materials provided with the distribution. | ||
15 | # | ||
16 | # * Neither the name of Pier Luigi Fiorini nor the names of his | ||
17 | # contributors may be used to endorse or promote products derived | ||
18 | # from this software without specific prior written permission. | ||
19 | # | ||
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
24 | # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
31 | #============================================================================= | ||
32 | |||
33 | find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) | ||
34 | |||
35 | # wayland_add_protocol_client(outfiles inputfile basename) | ||
36 | function(WAYLAND_ADD_PROTOCOL_CLIENT _sources _protocol _basename) | ||
37 | if(NOT WAYLAND_SCANNER_EXECUTABLE) | ||
38 | message(FATAL "The wayland-scanner executable has nto been found on your system. You must install it.") | ||
39 | endif() | ||
40 | |||
41 | get_filename_component(_infile ${_protocol} ABSOLUTE) | ||
42 | set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-client-protocol.h") | ||
43 | set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c") | ||
44 | |||
45 | add_custom_command(OUTPUT "${_client_header}" | ||
46 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header < ${_infile} > ${_client_header} | ||
47 | DEPENDS ${_infile} VERBATIM) | ||
48 | |||
49 | add_custom_command(OUTPUT "${_code}" | ||
50 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code} | ||
51 | DEPENDS ${_infile} VERBATIM) | ||
52 | |||
53 | list(APPEND ${_sources} "${_client_header}" "${_code}") | ||
54 | set(${_sources} ${${_sources}} PARENT_SCOPE) | ||
55 | endfunction() | ||
56 | |||
57 | # wayland_add_protocol_server(outfiles inputfile basename) | ||
58 | function(WAYLAND_ADD_PROTOCOL_SERVER _sources _protocol _basename) | ||
59 | if(NOT WAYLAND_SCANNER_EXECUTABLE) | ||
60 | message(FATAL "The wayland-scanner executable has nto been found on your system. You must install it.") | ||
61 | endif() | ||
62 | |||
63 | get_filename_component(_infile ${_protocol} ABSOLUTE) | ||
64 | set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-server-protocol.h") | ||
65 | set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${_basename}-protocol.c") | ||
66 | |||
67 | add_custom_command(OUTPUT "${_server_header}" | ||
68 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} server-header < ${_infile} > ${_server_header} | ||
69 | DEPENDS ${_infile} VERBATIM) | ||
70 | |||
71 | add_custom_command(OUTPUT "${_code}" | ||
72 | COMMAND ${WAYLAND_SCANNER_EXECUTABLE} code < ${_infile} > ${_code} | ||
73 | DEPENDS ${_infile} VERBATIM) | ||
74 | |||
75 | list(APPEND ${_sources} "${_server_header}" "${_code}") | ||
76 | set(${_sources} ${${_sources}} PARENT_SCOPE) | ||
77 | endfunction() | ||