aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-12-01 08:21:01 -0500
committerLibravatar GitHub <noreply@github.com>2017-12-01 08:21:01 -0500
commit1cfebe827ae53a243ffdd1e09f8b71d4c1a4e254 (patch)
treeb74002984ff80201c02ed9c22ca2fe1cdae98e23
parentMerge pull request #1482 from acrisci/refactor/use-frame-done (diff)
parentupdate travis (diff)
downloadsway-1cfebe827ae53a243ffdd1e09f8b71d4c1a4e254.tar.gz
sway-1cfebe827ae53a243ffdd1e09f8b71d4c1a4e254.tar.zst
sway-1cfebe827ae53a243ffdd1e09f8b71d4c1a4e254.zip
Merge pull request #1479 from acrisci/feature/meson-build
meson build
-rw-r--r--.build.yml21
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml26
-rw-r--r--CMake/FindA2X.cmake75
-rw-r--r--CMake/FindCairo.cmake42
-rw-r--r--CMake/FindDBus.cmake59
-rw-r--r--CMake/FindEpollShim.cmake17
-rw-r--r--CMake/FindGdkPixbuf.cmake43
-rw-r--r--CMake/FindJsonC.cmake29
-rw-r--r--CMake/FindLibInput.cmake66
-rw-r--r--CMake/FindLibcap.cmake56
-rw-r--r--CMake/FindPAM.cmake245
-rw-r--r--CMake/FindPCRE.cmake37
-rw-r--r--CMake/FindPango.cmake42
-rw-r--r--CMake/FindWLC.cmake20
-rw-r--r--CMake/FindWayland.cmake67
-rw-r--r--CMake/FindWlroots.cmake20
-rw-r--r--CMake/FindXKBCommon.cmake19
-rw-r--r--CMake/Manpage.cmake33
-rw-r--r--CMake/Wayland.cmake77
-rw-r--r--CMakeLists.txt165
-rw-r--r--HACKING.md11
-rw-r--r--README.de.md10
-rw-r--r--README.el.md10
-rw-r--r--README.fr.md10
-rw-r--r--README.it.md10
-rw-r--r--README.ja.md10
-rw-r--r--README.md10
-rw-r--r--README.pt.md10
-rw-r--r--README.ru.md10
-rw-r--r--README.uk.md10
-rw-r--r--common/CMakeLists.txt15
-rw-r--r--common/meson.build11
-rw-r--r--completions/zsh/CMakeLists.txt4
-rw-r--r--config.in4
-rw-r--r--meson.build147
-rw-r--r--meson_options.txt3
-rw-r--r--protocols/CMakeLists.txt46
-rw-r--r--security.d/00-defaults.in18
-rw-r--r--sway/CMakeLists.txt96
-rw-r--r--sway/meson.build31
-rw-r--r--swaybar/CMakeLists.txt51
-rw-r--r--swaybg/CMakeLists.txt37
-rw-r--r--swaygrab/CMakeLists.txt28
-rw-r--r--swaylock/CMakeLists.txt51
-rw-r--r--swaymsg/CMakeLists.txt23
-rw-r--r--swaymsg/meson.build8
-rw-r--r--wayland/CMakeLists.txt32
48 files changed, 266 insertions, 1603 deletions
diff --git a/.build.yml b/.build.yml
index 3717d699..a2f855e9 100644
--- a/.build.yml
+++ b/.build.yml
@@ -1,7 +1,7 @@
1# vim: ft=yaml ts=2 sw=2 et : 1# vim: ft=yaml ts=2 sw=2 et :
2image: archlinux 2image: archlinux
3packages: 3packages:
4 - cmake 4 - meson
5 - wlc-git 5 - wlc-git
6 - xorg-server-xwayland 6 - xorg-server-xwayland
7 - xcb-util-image 7 - xcb-util-image
@@ -9,25 +9,22 @@ packages:
9 - pango 9 - pango
10 - cairo 10 - cairo
11 - wayland 11 - wayland
12 - wayland-protocols
12 - gdk-pixbuf2 13 - gdk-pixbuf2
13 - meson 14 - libinput
15 - libxkbcommon
14sources: 16sources:
15 - https://git.sr.ht/~sircmpwn/sway 17 - https://git.sr.ht/~sircmpwn/sway
16 - https://git.sr.ht/~sircmpwn/wlroots 18 - https://git.sr.ht/~sircmpwn/wlroots
17tasks: 19tasks:
18 - wlroots: | 20 - wlroots: |
19 cd wlroots 21 cd wlroots
20 mkdir build 22 meson --prefix=/usr build
21 cd build 23 ninja -C build
22 meson --prefix=/usr .. 24 sudo ninja -C build install
23 ninja
24 sudo ninja install
25 - setup: | 25 - setup: |
26 cd sway 26 cd sway
27 mkdir build 27 meson build
28 cd build
29 cmake ..
30 - build: | 28 - build: |
31 cd sway 29 cd sway
32 cd build 30 ninja -C build
33 make
diff --git a/.gitignore b/.gitignore
index 48f8a0cb..b6e56f7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,3 @@
1CMakeCache.txt
2CMakeFiles
3Makefile
4cmake_install.cmake
5install_manifest.txt 1install_manifest.txt
6*.swp 2*.swp
7*.o 3*.o
diff --git a/.travis.yml b/.travis.yml
index bc1ee45b..db717718 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,35 +7,29 @@ compiler:
7 - clang 7 - clang
8 8
9env: 9env:
10 - BUILD_TYPE=Release 10 - BUILD_TYPE=release
11 - BUILD_TYPE=Debug 11 - BUILD_TYPE=debug
12 - BUILD_TYPE=ASAN
13 12
14arch: 13arch:
15 packages: 14 packages:
16 - cmake 15 - meson
16 - ninja
17 - xorg-server-xwayland 17 - xorg-server-xwayland
18 - json-c 18 - json-c
19 - wayland 19 - wayland
20 - wayland-protocols
20 - xcb-util-image 21 - xcb-util-image
21 - pango 22 - pango
22 - cairo 23 - cairo
23 - gdk-pixbuf2 24 - gdk-pixbuf2
24 - wlc-git
25 - libcap 25 - libcap
26 - meson 26 - libinput
27 - libxkbcommon
27 script: 28 script:
28 - git clone https://github.com/swaywm/wlroots 29 - git clone https://github.com/swaywm/wlroots
29 - cd wlroots 30 - 'cd wlroots && meson --prefix=/usr build && ninja -C build && sudo ninja -C build install'
30 - mkdir build 31 - meson build --buildtype=$BUILD_TYPE
31 - cd build 32 - ninja -C build
32 - meson --prefix=/usr ..
33 - sudo ninja install
34 - cd ../..
35 - cmake .
36 - make
37 - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .
38 - make
39 33
40script: 34script:
41 - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash" 35 - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"
diff --git a/CMake/FindA2X.cmake b/CMake/FindA2X.cmake
deleted file mode 100644
index b38f5086..00000000
--- a/CMake/FindA2X.cmake
+++ /dev/null
@@ -1,75 +0,0 @@
1#
2# (c)2015 KiCad Developers
3# (c)2015 Brian Sidebotham <brian.sidebotham@gmail.com>
4#
5# CMake module to find a2x (part of the asciidoc toolchain).
6#
7# Variables generated:
8#
9# A2X_FOUND true when A2X_COMMAND is valid
10# A2X_COMMAND The command to run a2x (may be a list including an interpreter)
11# A2X_VERSION The a2x version that has been found
12#
13
14# Have a go at finding a a2x executable
15find_program( A2X_PROGRAM a2x )
16
17# Found something, attempt to try and use it...
18if( A2X_PROGRAM )
19 execute_process(
20 COMMAND ${A2X_PROGRAM} --version
21 OUTPUT_VARIABLE _OUT
22 ERROR_VARIABLE _ERR
23 RESULT_VARIABLE _RES
24 OUTPUT_STRIP_TRAILING_WHITESPACE )
25
26 # If it worked, set the A2X_COMMAND
27 if( _RES MATCHES 0 )
28 set( A2X_COMMAND "${A2X_PROGRAM}" )
29 endif()
30endif()
31
32# If nothing could be found, test to see if we can just find the script file,
33# that we'll then run with the python interpreter
34if( NOT A2X_COMMAND )
35 find_file( A2X_SCRIPT a2x.py )
36
37 if( A2X_SCRIPT )
38 # Find the python interpreter quietly
39 if( NOT PYTHONINTERP_FOUND )
40 find_package( PYTHONINTERP QUIET )
41 endif()
42
43 if( NOT PYTHONINTERP_FOUND )
44 # Python's not available so can't find a2x...
45 set( A2X_COMMAND "" )
46 else()
47 # Build the python based command
48 set( A2X_COMMAND "${PYTHON_EXECUTABLE}" "${A2X_SCRIPT}" )
49
50 execute_process(
51 COMMAND ${A2X_COMMAND} --version
52 OUTPUT_VARIABLE _OUT
53 ERROR_VARIABLE _ERR
54 RESULT_VARIABLE _RES
55 OUTPUT_STRIP_TRAILING_WHITESPACE )
56
57 # If it still can't be run, then give up
58 if( NOT _RES MATCHES 0 )
59 set( A2X_COMMAND "" )
60 endif()
61 endif()
62 endif()
63endif()
64
65# If we've found a command that works, check the version
66if( A2X_COMMAND )
67 string(REGEX REPLACE ".*a2x[^0-9.]*\([0-9.]+\).*" "\\1" A2X_VERSION "${_OUT}")
68endif()
69
70# Generate the *_FOUND as necessary, etc.
71include( FindPackageHandleStandardArgs )
72find_package_handle_standard_args(
73 A2X
74 REQUIRED_VARS A2X_COMMAND
75 VERSION_VAR A2X_VERSION )
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake
deleted file mode 100644
index 10ab8fb0..00000000
--- a/CMake/FindCairo.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
1# - Try to find the cairo library
2# Once done this will define
3#
4# CAIRO_FOUND - system has cairo
5# CAIRO_INCLUDE_DIRS - the cairo include directory
6# CAIRO_LIBRARIES - Link these to use cairo
7#
8# Define CAIRO_MIN_VERSION for which version desired.
9#
10
11find_package(PkgConfig)
12
13if(Cairo_FIND_REQUIRED)
14 set(_pkgconfig_REQUIRED "REQUIRED")
15else(Cairo_FIND_REQUIRED)
16 set(_pkgconfig_REQUIRED "")
17endif(Cairo_FIND_REQUIRED)
18
19if(CAIRO_MIN_VERSION)
20 pkg_check_modules(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION})
21else(CAIRO_MIN_VERSION)
22 pkg_check_modules(CAIRO ${_pkgconfig_REQUIRED} cairo)
23endif(CAIRO_MIN_VERSION)
24
25if(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
26 find_path(CAIRO_INCLUDE_DIRS cairo.h)
27 find_library(CAIRO_LIBRARIES cairo)
28else(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
29 # Make paths absolute https://stackoverflow.com/a/35476270
30 # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path
31 set(CAIRO_LIBS_ABSOLUTE)
32 foreach(lib ${CAIRO_LIBRARIES})
33 set(var_name CAIRO_${lib}_ABS)
34 find_library(${var_name} ${lib} ${CAIRO_LIBRARY_DIRS})
35 list(APPEND CAIRO_LIBS_ABSOLUTE ${${var_name}})
36 endforeach()
37 set(CAIRO_LIBRARIES ${CAIRO_LIBS_ABSOLUTE})
38endif(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
39
40include(FindPackageHandleStandardArgs)
41find_package_handle_standard_args(CAIRO DEFAULT_MSG CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)
42mark_as_advanced(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)
diff --git a/CMake/FindDBus.cmake b/CMake/FindDBus.cmake
deleted file mode 100644
index 4a1a1805..00000000
--- a/CMake/FindDBus.cmake
+++ /dev/null
@@ -1,59 +0,0 @@
1# - Try to find DBus
2# Once done, this will define
3#
4# DBUS_FOUND - system has DBus
5# DBUS_INCLUDE_DIRS - the DBus include directories
6# DBUS_LIBRARIES - link these to use DBus
7#
8# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
9#
10# Redistribution and use in source and binary forms, with or without
11# modification, are permitted provided that the following conditions
12# are met:
13# 1. Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer.
15# 2. Redistributions in binary form must reproduce the above copyright
16# notice, this list of conditions and the following disclaimer in the
17# documentation and/or other materials provided with the distribution.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
20# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
23# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31FIND_PACKAGE(PkgConfig)
32PKG_CHECK_MODULES(PC_DBUS QUIET dbus-1)
33
34FIND_LIBRARY(DBUS_LIBRARIES
35 NAMES dbus-1
36 HINTS ${PC_DBUS_LIBDIR}
37 ${PC_DBUS_LIBRARY_DIRS}
38)
39
40FIND_PATH(DBUS_INCLUDE_DIR
41 NAMES dbus/dbus.h
42 HINTS ${PC_DBUS_INCLUDEDIR}
43 ${PC_DBUS_INCLUDE_DIRS}
44)
45
46GET_FILENAME_COMPONENT(_DBUS_LIBRARY_DIR ${DBUS_LIBRARIES} PATH)
47FIND_PATH(DBUS_ARCH_INCLUDE_DIR
48 NAMES dbus/dbus-arch-deps.h
49 HINTS ${PC_DBUS_INCLUDEDIR}
50 ${PC_DBUS_INCLUDE_DIRS}
51 ${_DBUS_LIBRARY_DIR}
52 ${DBUS_INCLUDE_DIR}
53 PATH_SUFFIXES include
54)
55
56SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
57
58INCLUDE(FindPackageHandleStandardArgs)
59FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
diff --git a/CMake/FindEpollShim.cmake b/CMake/FindEpollShim.cmake
deleted file mode 100644
index b6bed142..00000000
--- a/CMake/FindEpollShim.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
1# - Find EpollShim
2# Once done, this will define
3#
4# EPOLLSHIM_FOUND - System has EpollShim
5# EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories
6# EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim
7
8find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
9find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
10
11if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
12 set(EPOLLSHIM_FOUND TRUE)
13endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
14
15include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
17mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
diff --git a/CMake/FindGdkPixbuf.cmake b/CMake/FindGdkPixbuf.cmake
deleted file mode 100644
index 9cad4f92..00000000
--- a/CMake/FindGdkPixbuf.cmake
+++ /dev/null
@@ -1,43 +0,0 @@
1# - Try to find the gdk-pixbuf-2.0 library
2# Once done this will define
3#
4# GDK_PIXBUF_FOUND - system has gdk-pixbuf-2.0
5# GDK_PIXBUF_INCLUDE_DIRS - the gdk-pixbuf-2.0 include directory
6# GDK_PIXBUF_LIBRARIES - Link these to use gdk-pixbuf-2.0
7#
8# Define GDK_PIXBUF_MIN_VERSION for which version desired.
9#
10
11find_package(PkgConfig)
12
13if(GdkPixbuf_FIND_REQUIRED)
14 set(_pkgconfig_REQUIRED "REQUIRED")
15else(GdkPixbuf_FIND_REQUIRED)
16 set(_pkgconfig_REQUIRED "")
17endif(GdkPixbuf_FIND_REQUIRED)
18
19if(GDK_PIXBUF_MIN_VERSION)
20 pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}")
21else(GDK_PIXBUF_MIN_VERSION)
22 pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0")
23endif(GDK_PIXBUF_MIN_VERSION)
24
25if(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
26 find_path(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h)
27 find_library(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0)
28else(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
29 SET(GdkPixbuf_FOUND 1)
30 # Make paths absolute https://stackoverflow.com/a/35476270
31 # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path
32 set(GDK_PIXBUF_LIBS_ABSOLUTE)
33 foreach(lib ${GDK_PIXBUF_LIBRARIES})
34 set(var_name GDK_PIXBUF_${lib}_ABS)
35 find_library(${var_name} ${lib} ${GDK_PIXBUF_LIBRARY_DIRS})
36 list(APPEND GDK_PIXBUF_LIBS_ABSOLUTE ${${var_name}})
37 endforeach()
38 set(GDK_PIXBUF_LIBRARIES ${GDK_PIXBUF_LIBS_ABSOLUTE})
39endif(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
40
41include(FindPackageHandleStandardArgs)
42find_package_handle_standard_args(GDK_PIXBUF DEFAULT_MSG GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)
43mark_as_advanced(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)
diff --git a/CMake/FindJsonC.cmake b/CMake/FindJsonC.cmake
deleted file mode 100644
index bbf6930c..00000000
--- a/CMake/FindJsonC.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
1# - Find json-c
2# Find the json-c libraries
3#
4# This module defines the following variables:
5# JSONC_FOUND - True if JSONC is found
6# JSONC_LIBRARIES - JSONC libraries
7# JSONC_INCLUDE_DIRS - JSONC include directories
8#
9
10find_package(PkgConfig)
11
12if (JsonC_FIND_REQUIRED)
13 set(_pkgconfig_REQUIRED "REQUIRED")
14else()
15 set(_pkgconfig_REQUIRED "")
16endif()
17
18if(JsonC_FIND_VERSION)
19 pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c=${JsonC_FIND_VERSION})
20else()
21 pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c)
22endif()
23
24find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS})
25find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS})
26include(FindPackageHandleStandardArgs)
27
28find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS)
29mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS)
diff --git a/CMake/FindLibInput.cmake b/CMake/FindLibInput.cmake
deleted file mode 100644
index 87721998..00000000
--- a/CMake/FindLibInput.cmake
+++ /dev/null
@@ -1,66 +0,0 @@
1#.rst:
2# FindLibInput
3# -------
4#
5# Find LibInput library
6#
7# Try to find LibInpu library. The following values are defined
8#
9# ::
10#
11# LIBINPUT_FOUND - True if libinput is available
12# LIBINPUT_INCLUDE_DIRS - Include directories for libinput
13# LIBINPUT_LIBRARIES - List of libraries for libinput
14# LIBINPUT_DEFINITIONS - List of definitions for libinput
15#
16# and also the following more fine grained variables
17#
18# ::
19#
20# LIBINPUT_VERSION
21# LIBINPUT_VERSION_MAJOR
22# LIBINPUT_VERSION_MINOR
23# LIBINPUT_VERSION_MICRO
24#
25#=============================================================================
26# Copyright (c) 2015 Jari Vetoniemi
27#
28# Distributed under the OSI-approved BSD License (the "License");
29#
30# This software is distributed WITHOUT ANY WARRANTY; without even the
31# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
32# See the License for more information.
33#=============================================================================
34
35include(FeatureSummary)
36set_package_properties(LibInput PROPERTIES
37 URL "http://freedesktop.org/wiki/Software/libinput/"
38 DESCRIPTION "Library to handle input devices")
39
40find_package(PkgConfig)
41pkg_check_modules(PC_INPUT QUIET libinput)
42find_library(LIBINPUT_LIBRARIES NAMES input HINTS ${PC_INPUT_LIBRARY_DIRS})
43find_path(LIBINPUT_INCLUDE_DIRS libinput.h HINTS ${PC_INPUT_INCLUDE_DIRS})
44
45set(LIBINPUT_VERSION ${PC_INPUT_VERSION})
46string(REPLACE "." ";" VERSION_LIST "${PC_INPUT_VERSION}")
47
48LIST(LENGTH VERSION_LIST n)
49if (n EQUAL 3)
50 list(GET VERSION_LIST 0 LIBINPUT_VERSION_MAJOR)
51 list(GET VERSION_LIST 1 LIBINPUT_VERSION_MINOR)
52 list(GET VERSION_LIST 2 LIBINPUT_VERSION_MICRO)
53endif ()
54
55# This is compatible with libinput-version.h that exists in upstream
56# but isn't in distribution (probably forgotten)
57set(LIBINPUT_DEFINITIONS ${PC_INPUT_CFLAGS_OTHER}
58 -DLIBINPUT_VERSION=\"${LIBINPUT_VERSION}\"
59 -DLIBINPUT_VERSION_MAJOR=${LIBINPUT_VERSION_MAJOR}
60 -DLIBINPUT_VERSION_MINOR=${LIBINPUT_VERSION_MINOR}
61 -DLIBINPUT_VERSION_MICRO=${LIBINPUT_VERSION_MICRO})
62
63include(FindPackageHandleStandardArgs)
64find_package_handle_standard_args(LIBINPUT DEFAULT_MSG LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES)
65mark_as_advanced(LIBINPUT_INCLUDE_DIRS LIBINPUT_LIBRARIES LIBINPUT_DEFINITIONS
66 LIBINPUT_VERSION LIBINPUT_VERSION_MAJOR LIBINPUT_VERSION_MICRO LIBINPUT_VERSION_MINOR)
diff --git a/CMake/FindLibcap.cmake b/CMake/FindLibcap.cmake
deleted file mode 100644
index b34e5e37..00000000
--- a/CMake/FindLibcap.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
1#.rst:
2# FindLibcap
3# -------
4#
5# Find Libcap library
6#
7# Try to find Libcap library. The following values are defined
8#
9# ::
10#
11# Libcap_FOUND - True if Libcap is available
12# Libcap_INCLUDE_DIRS - Include directories for Libcap
13# Libcap_LIBRARIES - List of libraries for Libcap
14# Libcap_DEFINITIONS - List of definitions for Libcap
15#
16# and also the following more fine grained variables
17#
18# ::
19#
20# Libcap_VERSION
21# Libcap_VERSION_MAJOR
22# Libcap_VERSION_MINOR
23#
24#=============================================================================
25# Copyright (c) 2017 Jerzi Kaminsky
26#
27# Distributed under the OSI-approved BSD License (the "License");
28#
29# This software is distributed WITHOUT ANY WARRANTY; without even the
30# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31# See the License for more information.
32#=============================================================================
33
34include(FeatureSummary)
35set_package_properties(Libcap PROPERTIES
36 URL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2"
37 DESCRIPTION "Library for getting and setting POSIX.1e capabilities")
38
39find_package(PkgConfig)
40pkg_check_modules(PC_CAP QUIET Libcap)
41find_library(Libcap_LIBRARIES NAMES cap HINTS ${PC_CAP_LIBRARY_DIRS})
42find_path(Libcap_INCLUDE_DIRS sys/capability.h HINTS ${PC_CAP_INCLUDE_DIRS})
43
44set(Libcap_VERSION ${PC_CAP_VERSION})
45string(REPLACE "." ";" VERSION_LIST "${PC_CAP_VERSION}")
46
47LIST(LENGTH VERSION_LIST n)
48if (n EQUAL 2)
49 list(GET VERSION_LIST 0 Libcap_VERSION_MAJOR)
50 list(GET VERSION_LIST 1 Libcap_VERSION_MINOR)
51endif ()
52
53include(FindPackageHandleStandardArgs)
54find_package_handle_standard_args(Libcap DEFAULT_MSG Libcap_INCLUDE_DIRS Libcap_LIBRARIES)
55mark_as_advanced(Libcap_INCLUDE_DIRS Libcap_LIBRARIES Libcap_DEFINITIONS
56 Libcap_VERSION Libcap_VERSION_MAJOR Libcap_VERSION_MICRO Libcap_VERSION_MINOR)
diff --git a/CMake/FindPAM.cmake b/CMake/FindPAM.cmake
deleted file mode 100644
index 7e6e333a..00000000
--- a/CMake/FindPAM.cmake
+++ /dev/null
@@ -1,245 +0,0 @@
1# - Try to find the PAM libraries
2# Once done this will define
3#
4# PAM_FOUND - system has pam
5# PAM_INCLUDE_DIR - the pam include directory
6# PAM_LIBRARIES - libpam library
7
8if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
9 set(PAM_FIND_QUIETLY TRUE)
10endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
11
12find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
13find_library(PAM_LIBRARY pam)
14find_library(DL_LIBRARY dl)
15
16if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
17 set(PAM_FOUND TRUE)
18 if (DL_LIBRARY)
19 set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
20 else (DL_LIBRARY)
21 set(PAM_LIBRARIES ${PAM_LIBRARY})
22 endif (DL_LIBRARY)
23
24 if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
25 set(HAVE_PAM_PAM_APPL_H 1)
26 endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
27endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
28
29if (PAM_FOUND)
30 if (NOT PAM_FIND_QUIETLY)
31 message(STATUS "Found PAM: ${PAM_LIBRARIES}")
32 endif (NOT PAM_FIND_QUIETLY)
33else (PAM_FOUND)
34 if (PAM_FIND_REQUIRED)
35 message(FATAL_ERROR "PAM was not found")
36 endif(PAM_FIND_REQUIRED)
37endif (PAM_FOUND)
38
39mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY)
40
41# This file taken from https://github.com/FreeRDP/FreeRDP
42#
43#
44#
45# Apache License
46# Version 2.0, January 2004
47# http://www.apache.org/licenses/
48#
49# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
50#
51# 1. Definitions.
52#
53# "License" shall mean the terms and conditions for use, reproduction,
54# and distribution as defined by Sections 1 through 9 of this document.
55#
56# "Licensor" shall mean the copyright owner or entity authorized by
57# the copyright owner that is granting the License.
58#
59# "Legal Entity" shall mean the union of the acting entity and all
60# other entities that control, are controlled by, or are under common
61# control with that entity. For the purposes of this definition,
62# "control" means (i) the power, direct or indirect, to cause the
63# direction or management of such entity, whether by contract or
64# otherwise, or (ii) ownership of fifty percent (50%) or more of the
65# outstanding shares, or (iii) beneficial ownership of such entity.
66#
67# "You" (or "Your") shall mean an individual or Legal Entity
68# exercising permissions granted by this License.
69#
70# "Source" form shall mean the preferred form for making modifications,
71# including but not limited to software source code, documentation
72# source, and configuration files.
73#
74# "Object" form shall mean any form resulting from mechanical
75# transformation or translation of a Source form, including but
76# not limited to compiled object code, generated documentation,
77# and conversions to other media types.
78#
79# "Work" shall mean the work of authorship, whether in Source or
80# Object form, made available under the License, as indicated by a
81# copyright notice that is included in or attached to the work
82# (an example is provided in the Appendix below).
83#
84# "Derivative Works" shall mean any work, whether in Source or Object
85# form, that is based on (or derived from) the Work and for which the
86# editorial revisions, annotations, elaborations, or other modifications
87# represent, as a whole, an original work of authorship. For the purposes
88# of this License, Derivative Works shall not include works that remain
89# separable from, or merely link (or bind by name) to the interfaces of,
90# the Work and Derivative Works thereof.
91#
92# "Contribution" shall mean any work of authorship, including
93# the original version of the Work and any modifications or additions
94# to that Work or Derivative Works thereof, that is intentionally
95# submitted to Licensor for inclusion in the Work by the copyright owner
96# or by an individual or Legal Entity authorized to submit on behalf of
97# the copyright owner. For the purposes of this definition, "submitted"
98# means any form of electronic, verbal, or written communication sent
99# to the Licensor or its representatives, including but not limited to
100# communication on electronic mailing lists, source code control systems,
101# and issue tracking systems that are managed by, or on behalf of, the
102# Licensor for the purpose of discussing and improving the Work, but
103# excluding communication that is conspicuously marked or otherwise
104# designated in writing by the copyright owner as "Not a Contribution."
105#
106# "Contributor" shall mean Licensor and any individual or Legal Entity
107# on behalf of whom a Contribution has been received by Licensor and
108# subsequently incorporated within the Work.
109#
110# 2. Grant of Copyright License. Subject to the terms and conditions of
111# this License, each Contributor hereby grants to You a perpetual,
112# worldwide, non-exclusive, no-charge, royalty-free, irrevocable
113# copyright license to reproduce, prepare Derivative Works of,
114# publicly display, publicly perform, sublicense, and distribute the
115# Work and such Derivative Works in Source or Object form.
116#
117# 3. Grant of Patent License. Subject to the terms and conditions of
118# this License, each Contributor hereby grants to You a perpetual,
119# worldwide, non-exclusive, no-charge, royalty-free, irrevocable
120# (except as stated in this section) patent license to make, have made,
121# use, offer to sell, sell, import, and otherwise transfer the Work,
122# where such license applies only to those patent claims licensable
123# by such Contributor that are necessarily infringed by their
124# Contribution(s) alone or by combination of their Contribution(s)
125# with the Work to which such Contribution(s) was submitted. If You
126# institute patent litigation against any entity (including a
127# cross-claim or counterclaim in a lawsuit) alleging that the Work
128# or a Contribution incorporated within the Work constitutes direct
129# or contributory patent infringement, then any patent licenses
130# granted to You under this License for that Work shall terminate
131# as of the date such litigation is filed.
132#
133# 4. Redistribution. You may reproduce and distribute copies of the
134# Work or Derivative Works thereof in any medium, with or without
135# modifications, and in Source or Object form, provided that You
136# meet the following conditions:
137#
138# (a) You must give any other recipients of the Work or
139# Derivative Works a copy of this License; and
140#
141# (b) You must cause any modified files to carry prominent notices
142# stating that You changed the files; and
143#
144# (c) You must retain, in the Source form of any Derivative Works
145# that You distribute, all copyright, patent, trademark, and
146# attribution notices from the Source form of the Work,
147# excluding those notices that do not pertain to any part of
148# the Derivative Works; and
149#
150# (d) If the Work includes a "NOTICE" text file as part of its
151# distribution, then any Derivative Works that You distribute must
152# include a readable copy of the attribution notices contained
153# within such NOTICE file, excluding those notices that do not
154# pertain to any part of the Derivative Works, in at least one
155# of the following places: within a NOTICE text file distributed
156# as part of the Derivative Works; within the Source form or
157# documentation, if provided along with the Derivative Works; or,
158# within a display generated by the Derivative Works, if and
159# wherever such third-party notices normally appear. The contents
160# of the NOTICE file are for informational purposes only and
161# do not modify the License. You may add Your own attribution
162# notices within Derivative Works that You distribute, alongside
163# or as an addendum to the NOTICE text from the Work, provided
164# that such additional attribution notices cannot be construed
165# as modifying the License.
166#
167# You may add Your own copyright statement to Your modifications and
168# may provide additional or different license terms and conditions
169# for use, reproduction, or distribution of Your modifications, or
170# for any such Derivative Works as a whole, provided Your use,
171# reproduction, and distribution of the Work otherwise complies with
172# the conditions stated in this License.
173#
174# 5. Submission of Contributions. Unless You explicitly state otherwise,
175# any Contribution intentionally submitted for inclusion in the Work
176# by You to the Licensor shall be under the terms and conditions of
177# this License, without any additional terms or conditions.
178# Notwithstanding the above, nothing herein shall supersede or modify
179# the terms of any separate license agreement you may have executed
180# with Licensor regarding such Contributions.
181#
182# 6. Trademarks. This License does not grant permission to use the trade
183# names, trademarks, service marks, or product names of the Licensor,
184# except as required for reasonable and customary use in describing the
185# origin of the Work and reproducing the content of the NOTICE file.
186#
187# 7. Disclaimer of Warranty. Unless required by applicable law or
188# agreed to in writing, Licensor provides the Work (and each
189# Contributor provides its Contributions) on an "AS IS" BASIS,
190# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
191# implied, including, without limitation, any warranties or conditions
192# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
193# PARTICULAR PURPOSE. You are solely responsible for determining the
194# appropriateness of using or redistributing the Work and assume any
195# risks associated with Your exercise of permissions under this License.
196#
197# 8. Limitation of Liability. In no event and under no legal theory,
198# whether in tort (including negligence), contract, or otherwise,
199# unless required by applicable law (such as deliberate and grossly
200# negligent acts) or agreed to in writing, shall any Contributor be
201# liable to You for damages, including any direct, indirect, special,
202# incidental, or consequential damages of any character arising as a
203# result of this License or out of the use or inability to use the
204# Work (including but not limited to damages for loss of goodwill,
205# work stoppage, computer failure or malfunction, or any and all
206# other commercial damages or losses), even if such Contributor
207# has been advised of the possibility of such damages.
208#
209# 9. Accepting Warranty or Additional Liability. While redistributing
210# the Work or Derivative Works thereof, You may choose to offer,
211# and charge a fee for, acceptance of support, warranty, indemnity,
212# or other liability obligations and/or rights consistent with this
213# License. However, in accepting such obligations, You may act only
214# on Your own behalf and on Your sole responsibility, not on behalf
215# of any other Contributor, and only if You agree to indemnify,
216# defend, and hold each Contributor harmless for any liability
217# incurred by, or claims asserted against, such Contributor by reason
218# of your accepting any such warranty or additional liability.
219#
220# END OF TERMS AND CONDITIONS
221#
222# APPENDIX: How to apply the Apache License to your work.
223#
224# To apply the Apache License to your work, attach the following
225# boilerplate notice, with the fields enclosed by brackets "[]"
226# replaced with your own identifying information. (Don't include
227# the brackets!) The text should be enclosed in the appropriate
228# comment syntax for the file format. We also recommend that a
229# file or class name and description of purpose be included on the
230# same "printed page" as the copyright notice for easier
231# identification within third-party archives.
232#
233# Copyright [yyyy] [name of copyright owner]
234#
235# Licensed under the Apache License, Version 2.0 (the "License");
236# you may not use this file except in compliance with the License.
237# You may obtain a copy of the License at
238#
239# http://www.apache.org/licenses/LICENSE-2.0
240#
241# Unless required by applicable law or agreed to in writing, software
242# distributed under the License is distributed on an "AS IS" BASIS,
243# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244# See the License for the specific language governing permissions and
245# limitations under the License.
diff --git a/CMake/FindPCRE.cmake b/CMake/FindPCRE.cmake
deleted file mode 100644
index dbbd60ad..00000000
--- a/CMake/FindPCRE.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
1# Copyright (C) 2007-2009 LuaDist.
2# Created by Peter Kapec <kapecp@gmail.com>
3# Redistribution and use of this file is allowed according to the terms of the MIT license.
4# For details see the COPYRIGHT file distributed with LuaDist.
5# Note:
6# Searching headers and libraries is very simple and is NOT as powerful as scripts
7# distributed with CMake, because LuaDist defines directories to search for.
8# Everyone is encouraged to contact the author with improvements. Maybe this file
9# becomes part of CMake distribution sometimes.
10
11# - Find pcre
12# Find the native PCRE headers and libraries.
13#
14# PCRE_INCLUDE_DIRS - where to find pcre.h, etc.
15# PCRE_LIBRARIES - List of libraries when using pcre.
16# PCRE_FOUND - True if pcre found.
17
18# Look for the header file.
19FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h)
20
21# Look for the library.
22FIND_LIBRARY(PCRE_LIBRARY NAMES pcre)
23
24# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE.
25INCLUDE(FindPackageHandleStandardArgs)
26FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)
27
28# Copy the results to the output variables.
29IF(PCRE_FOUND)
30 SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
31 SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
32ELSE(PCRE_FOUND)
33 SET(PCRE_LIBRARIES)
34 SET(PCRE_INCLUDE_DIRS)
35ENDIF(PCRE_FOUND)
36
37MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES)
diff --git a/CMake/FindPango.cmake b/CMake/FindPango.cmake
deleted file mode 100644
index eb296d75..00000000
--- a/CMake/FindPango.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
1# - Try to find the pango library
2# Once done this will define
3#
4# PANGO_FOUND - system has pango
5# PANGO_INCLUDE_DIRS - the pango include directory
6# PANGO_LIBRARIES - Link these to use pango
7#
8# Define PANGO_MIN_VERSION for which version desired.
9#
10
11find_package(PkgConfig)
12
13if(Pango_FIND_REQUIRED)
14 set(_pkgconfig_REQUIRED "REQUIRED")
15else(Pango_FIND_REQUIRED)
16 set(_pkgconfig_REQUIRED "")
17endif(Pango_FIND_REQUIRED)
18
19if(PANGO_MIN_VERSION)
20 pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} "pango>=${PANGO_MIN_VERSION}" "pangocairo>=${PANGO_MIN_VERSION}")
21else(PANGO_MIN_VERSION)
22 pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} pango pangocairo)
23endif(PANGO_MIN_VERSION)
24
25if(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
26 find_path(PANGO_INCLUDE_DIRS pango.h)
27 find_library(PANGO_LIBRARIES pango pangocairo)
28else(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
29 # Make paths absolute https://stackoverflow.com/a/35476270
30 # Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path
31 set(PANGO_LIBS_ABSOLUTE)
32 foreach(lib ${PANGO_LIBRARIES})
33 set(var_name PANGO_${lib}_ABS)
34 find_library(${var_name} ${lib} ${PANGO_LIBRARY_DIRS})
35 list(APPEND PANGO_LIBS_ABSOLUTE ${${var_name}})
36 endforeach()
37 set(PANGO_LIBRARIES ${PANGO_LIBS_ABSOLUTE})
38endif(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
39
40include(FindPackageHandleStandardArgs)
41find_package_handle_standard_args(PANGO DEFAULT_MSG PANGO_LIBRARIES PANGO_INCLUDE_DIRS)
42mark_as_advanced(PANGO_LIBRARIES PANGO_INCLUDE_DIRS)
diff --git a/CMake/FindWLC.cmake b/CMake/FindWLC.cmake
deleted file mode 100644
index 15b26ce7..00000000
--- a/CMake/FindWLC.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
1# - Find wlc
2# Find the wlc libraries
3#
4# This module defines the following variables:
5# WLC_FOUND - True if wlc is found
6# WLC_LIBRARIES - wlc libraries
7# WLC_INCLUDE_DIRS - wlc include directories
8# WLC_DEFINITIONS - Compiler switches required for using wlc
9#
10
11find_package(PkgConfig)
12pkg_check_modules(PC_WLC QUIET wlc)
13find_path(WLC_INCLUDE_DIRS NAMES wlc/wlc.h HINTS ${PC_WLC_INCLUDE_DIRS})
14find_library(WLC_LIBRARIES NAMES wlc HINTS ${PC_WLC_LIBRARY_DIRS})
15
16set(WLC_DEFINITIONS ${PC_WLC_CFLAGS_OTHER})
17
18include(FindPackageHandleStandardArgs)
19find_package_handle_standard_args(wlc DEFAULT_MSG WLC_LIBRARIES WLC_INCLUDE_DIRS)
20mark_as_advanced(WLC_LIBRARIES WLC_INCLUDE_DIRS)
diff --git a/CMake/FindWayland.cmake b/CMake/FindWayland.cmake
deleted file mode 100644
index 69130fe0..00000000
--- a/CMake/FindWayland.cmake
+++ /dev/null
@@ -1,67 +0,0 @@
1# Try to find Wayland on a Unix system
2#
3# This will define:
4#
5# WAYLAND_FOUND - True if Wayland is found
6# WAYLAND_LIBRARIES - Link these to use Wayland
7# WAYLAND_INCLUDE_DIR - Include directory for Wayland
8# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
9#
10# In addition the following more fine grained variables will be defined:
11#
12# WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
13# WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
14# WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
15# WAYLAND_CURSOR_FOUND WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES
16#
17# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
18#
19# Redistribution and use is allowed according to the terms of the BSD license.
20# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
21
22IF (NOT WIN32)
23 IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES)
24 # In the cache already
25 SET(WAYLAND_FIND_QUIETLY TRUE)
26 ENDIF ()
27
28 # Use pkg-config to get the directories and then use these values
29 # in the FIND_PATH() and FIND_LIBRARY() calls
30 FIND_PACKAGE(PkgConfig)
31 PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor)
32
33 SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
34
35 FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
36 FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
37 FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
38 FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
39
40 FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
41 FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
42 FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
43 FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
44
45 set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR})
46
47 set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
48
49 list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR)
50
51 include(FindPackageHandleStandardArgs)
52
53 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR)
54 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR)
55 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR)
56 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR)
57 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR)
58
59 MARK_AS_ADVANCED(
60 WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES
61 WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
62 WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
63 WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
64 WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES
65 )
66
67ENDIF ()
diff --git a/CMake/FindWlroots.cmake b/CMake/FindWlroots.cmake
deleted file mode 100644
index 0e349d3a..00000000
--- a/CMake/FindWlroots.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
1# - Find wlroots
2# Find the wlroots libraries
3#
4# This module defines the following variables:
5# WLR_FOUND - True if wlroots is found
6# WLR_LIBRARIES - wlroots libraries
7# WLR_INCLUDE_DIRS - wlroots include directories
8# WLR_DEFINITIONS - Compiler switches required for using wlroots
9#
10
11find_package(PkgConfig)
12pkg_check_modules(PC_WLR QUIET wlroots)
13find_path(WLR_INCLUDE_DIRS NAMES wlr/config.h HINTS ${PC_WLR_INCLUDE_DIRS})
14find_library(WLR_LIBRARIES NAMES wlroots HINTS ${PC_WLR_LIBRARY_DIRS})
15
16set(WLR_DEFINITIONS ${PC_WLR_CFLAGS_OTHER})
17
18include(FindPackageHandleStandardArgs)
19find_package_handle_standard_args(wlr DEFAULT_MSG WLR_LIBRARIES WLR_INCLUDE_DIRS)
20mark_as_advanced(WLR_LIBRARIES WLR_INCLUDE_DIRS)
diff --git a/CMake/FindXKBCommon.cmake b/CMake/FindXKBCommon.cmake
deleted file mode 100644
index 30ac503a..00000000
--- a/CMake/FindXKBCommon.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
1# - Find XKBCommon
2# Once done, this will define
3#
4# XKBCOMMON_FOUND - System has XKBCommon
5# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
6# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
7# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
8
9find_package(PkgConfig)
10pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
11find_path(XKBCOMMON_INCLUDE_DIRS NAMES xkbcommon/xkbcommon.h HINTS ${PC_XKBCOMMON_INCLUDE_DIRS})
12find_library(XKBCOMMON_LIBRARIES NAMES xkbcommon HINTS ${PC_XKBCOMMON_LIBRARY_DIRS})
13
14set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
15
16include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
18mark_as_advanced(XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
19
diff --git a/CMake/Manpage.cmake b/CMake/Manpage.cmake
deleted file mode 100644
index bbd6f2dc..00000000
--- a/CMake/Manpage.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
1find_package(A2X)
2
3if (A2X_FOUND)
4 add_custom_target(man ALL)
5
6 function(add_manpage name section)
7 add_custom_command(
8 OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
9 COMMAND ${A2X_COMMAND}
10 --no-xmllint
11 --doctype manpage
12 --format manpage
13 -D ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
14 ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
15 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.${section}.txt
16 COMMENT Generating manpage for ${name}.${section}
17 )
18
19 add_custom_target(man-${name}.${section}
20 DEPENDS
21 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
22 )
23 add_dependencies(man
24 man-${name}.${section}
25 )
26
27 install(
28 FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
29 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man${section}
30 COMPONENT documentation
31 )
32 endfunction()
33endif()
diff --git a/CMake/Wayland.cmake b/CMake/Wayland.cmake
deleted file mode 100644
index f9349667..00000000
--- a/CMake/Wayland.cmake
+++ /dev/null
@@ -1,77 +0,0 @@
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
33find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
34
35# wayland_add_protocol_client(outfiles inputfile basename)
36function(WAYLAND_ADD_PROTOCOL_CLIENT _sources _protocol _basename)
37 if(NOT WAYLAND_SCANNER_EXECUTABLE)
38 message(FATAL "The wayland-scanner executable has not 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}-client-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)
55endfunction()
56
57# wayland_add_protocol_server(outfiles inputfile basename)
58function(WAYLAND_ADD_PROTOCOL_SERVER _sources _protocol _basename)
59 if(NOT WAYLAND_SCANNER_EXECUTABLE)
60 message(FATAL "The wayland-scanner executable has not 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}-server-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)
77endfunction()
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 9580e15d..00000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,165 +0,0 @@
1cmake_minimum_required(VERSION 3.1.0)
2
3project(sway C)
4
5add_compile_options(-g)
6set(CMAKE_C_STANDARD 99)
7set(CMAKE_C_EXTENSIONS OFF)
8set(CMAKE_POSITION_INDEPENDENT_CODE ON)
9set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
10add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror)
11
12# Add Address Sanitiezed build type
13set(CMAKE_C_FLAGS_ASAN
14 "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer"
15 CACHE STRING "Flags used by the C compiler during address sanitizer builds."
16 FORCE )
17mark_as_advanced(
18 CMAKE_C_FLAGS_ASAN
19 CMAKE_EXE_LINKER_FLAGS_DEBUG
20 CMAKE_SHARED_LINKER_FLAGS_DEBUG
21 )
22
23list(INSERT CMAKE_MODULE_PATH 0
24 ${CMAKE_CURRENT_SOURCE_DIR}/CMake
25 )
26
27if (VERSION)
28 add_definitions(-DSWAY_VERSION=\"${VERSION}\")
29else()
30 execute_process(
31 COMMAND git describe --always --tags
32 OUTPUT_VARIABLE GIT_COMMIT_HASH
33 OUTPUT_STRIP_TRAILING_WHITESPACE
34 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
35 )
36 execute_process(
37 COMMAND git rev-parse --abbrev-ref HEAD
38 OUTPUT_VARIABLE GIT_BRANCH
39 OUTPUT_STRIP_TRAILING_WHITESPACE
40 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
41 )
42
43 string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
44 add_definitions("-DSWAY_VERSION=\"${GIT_COMMIT_HASH} (${CURRENT_DATE}, branch \\\"${GIT_BRANCH}\\\")\"")
45endif()
46
47option(enable-swaylock "Enables the swaylock utility" YES)
48option(enable-swaybg "Enables the wallpaper utility" YES)
49option(enable-swaybar "Enables the swaybar utility" YES)
50option(enable-swaygrab "Enables the swaygrab utility" YES)
51option(enable-swaymsg "Enables the swaymsg utility" YES)
52option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES)
53option(enable-tray "Enables the swaybar tray" YES)
54option(zsh-completions "Zsh shell completions" NO)
55option(default-wallpaper "Installs the default wallpaper" YES)
56option(LD_LIBRARY_PATH "Configure sway's default LD_LIBRARY_PATH")
57
58if (LD_LIBRARY_PATH)
59 add_definitions(-D_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}")
60endif()
61
62find_package(JsonC 0.12.1 REQUIRED)
63find_package(PCRE REQUIRED)
64find_package(Wlroots REQUIRED)
65find_package(Wayland REQUIRED)
66find_package(XKBCommon REQUIRED)
67find_package(Cairo REQUIRED)
68find_package(Pango REQUIRED)
69find_package(GdkPixbuf)
70find_package(PAM)
71find_package(DBus 1.10)
72
73find_package(LibInput REQUIRED)
74
75if (CMAKE_SYSTEM_NAME STREQUAL Linux)
76 find_package(Libcap REQUIRED)
77endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
78
79if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
80 find_package(EpollShim REQUIRED)
81endif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
82
83include(FeatureSummary)
84include(Manpage)
85include(GNUInstallDirs)
86
87if (enable-gdk-pixbuf)
88 if (GDK_PIXBUF_FOUND)
89 set(WITH_GDK_PIXBUF YES)
90 add_definitions(-DWITH_GDK_PIXBUF)
91 else()
92 message(WARNING "gdk-pixbuf required but not found, only png images supported.")
93 endif()
94else()
95 message(STATUS "Building without gdk-pixbuf, only png images supported.")
96endif()
97
98if (enable-tray)
99 if (DBUS_FOUND)
100 set(ENABLE_TRAY TRUE)
101 add_definitions(-DENABLE_TRAY)
102 else()
103 message(WARNING "Tray required but DBus was not found. Tray will not be included")
104 endif()
105else()
106 message(STATUS "Building without the tray.")
107endif()
108
109include_directories(include)
110
111add_subdirectory(protocols)
112add_subdirectory(common)
113add_subdirectory(wayland)
114
115add_subdirectory(sway)
116if(enable-swaybg)
117 if(CAIRO_FOUND AND PANGO_FOUND)
118 # TODO WLR
119 #add_subdirectory(swaybg)
120 else()
121 message(WARNING "Not building swaybg - cairo, and pango are required.")
122 endif()
123endif()
124if(enable-swaymsg)
125 add_subdirectory(swaymsg)
126endif()
127if(enable-swaygrab)
128 # TODO WLR
129 #add_subdirectory(swaygrab)
130endif()
131if(enable-swaybar)
132 if(CAIRO_FOUND AND PANGO_FOUND)
133 # TODO WLR
134 #add_subdirectory(swaybar)
135 else()
136 message(WARNING "Not building swaybar - cairo, and pango are required.")
137 endif()
138endif()
139if(enable-swaylock)
140 if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
141 # TODO WLR
142 #add_subdirectory(swaylock)
143 else()
144 message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
145 endif()
146endif()
147if(zsh-completions)
148 add_subdirectory(completions/zsh)
149endif()
150install(
151 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
152 DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/wayland-sessions
153 COMPONENT data
154 )
155
156if(default-wallpaper)
157 install(
158 DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets/
159 DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/backgrounds/sway
160 COMPONENT data
161 FILES_MATCHING PATTERN "*Wallpaper*"
162 )
163endif()
164
165feature_summary(WHAT ALL)
diff --git a/HACKING.md b/HACKING.md
index cf18dbb0..3600db24 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -22,14 +22,3 @@ assertion fails.
22 22
23Outside of the compositor (swaymsg, swaybar, etc), using `assert.h` is 23Outside of the compositor (swaymsg, swaybar, etc), using `assert.h` is
24permitted. 24permitted.
25
26## Building against a local wlc
27
281. Build wlc as described [here](https://github.com/Cloudef/wlc#building)
292. Inside your sway source folder, tell `cmake` to use your local version of wlc:
30
31```bash
32cmake \
33 -DWLC_LIBRARIES=path/to/wlc/target/src/libwlc.so \
34 -DWLC_INCLUDE_DIRS=path/to/wlc/include .
35```
diff --git a/README.de.md b/README.de.md
index 701cc34f..47084ad3 100644
--- a/README.de.md
+++ b/README.de.md
@@ -52,7 +52,7 @@ schau im IRC-Channel vorbei oder schreibe eine e-Mail an sir@cmpwn.com (nur engl
52 52
53Abhängigkeiten: 53Abhängigkeiten:
54 54
55* cmake 55* meson
56* [wlc](https://github.com/Cloudef/wlc) 56* [wlc](https://github.com/Cloudef/wlc)
57* wayland 57* wayland
58* xwayland 58* xwayland
@@ -74,11 +74,9 @@ _\*\*Nur erforderlich für swaylock_
74 74
75Führe diese Befehle aus: 75Führe diese Befehle aus:
76 76
77 mkdir build 77 meson build
78 cd build 78 ninja -C build
79 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 79 sudo ninja -C build install
80 make
81 sudo make install
82 80
83In Systemen mit logind musst du `sway` einige Capabilities geben: 81In Systemen mit logind musst du `sway` einige Capabilities geben:
84 82
diff --git a/README.el.md b/README.el.md
index df39364f..dd1889e4 100644
--- a/README.el.md
+++ b/README.el.md
@@ -45,7 +45,7 @@ To username μου στο Freenode είναι kon14 και θα με βÏείτÎ
45 45
46Εγκατάσταση εξαÏτήσεων: 46Εγκατάσταση εξαÏτήσεων:
47 47
48* cmake 48* meson
49* [wlc](https://github.com/Cloudef/wlc) 49* [wlc](https://github.com/Cloudef/wlc)
50* wayland 50* wayland
51* xwayland 51* xwayland
@@ -67,11 +67,9 @@ _\*\*Απαιτείται μόνο για swaylock_
67 67
68Εκτελέστε αυτές τις εντολές: 68Εκτελέστε αυτές τις εντολές:
69 69
70 mkdir build 70 meson build
71 cd build 71 ninja -C build
72 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 72 sudo ninja -C build install
73 make
74 sudo make install
75 73
76Σε συστήματα με logind, χÏειάζεται να οÏίσετε μεÏικά δικαιώματα caps στο εκτελέσιμο αÏχείο: 74Σε συστήματα με logind, χÏειάζεται να οÏίσετε μεÏικά δικαιώματα caps στο εκτελέσιμο αÏχείο:
77 75
diff --git a/README.fr.md b/README.fr.md
index 47b6c410..5baee7a8 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -47,7 +47,7 @@ IRC ou envoyez un e-mail à sir@cmpwn.com (en anglais seulement) pour des consei
47 47
48Installez les dépendances : 48Installez les dépendances :
49 49
50* cmake 50* meson
51* [wlc](https://github.com/Cloudef/wlc) 51* [wlc](https://github.com/Cloudef/wlc)
52* wayland 52* wayland
53* xwayland 53* xwayland
@@ -69,11 +69,9 @@ _\*\*Uniquement requis pour swaylock_
69 69
70Exécutez ces commandes : 70Exécutez ces commandes :
71 71
72 mkdir build 72 meson build
73 cd build 73 ninja -C build
74 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 74 sudo ninja -C build install
75 make
76 sudo make install
77 75
78Sur les systèmes avec logind, vous devez définir quelques caps sur le binaire : 76Sur les systèmes avec logind, vous devez définir quelques caps sur le binaire :
79 77
diff --git a/README.it.md b/README.it.md
index f5e0d8e2..af344405 100644
--- a/README.it.md
+++ b/README.it.md
@@ -48,7 +48,7 @@ a sir@cmpwn.com.
48 48
49Installa queste dipendenze: 49Installa queste dipendenze:
50 50
51* cmake 51* meson
52* [wlc](https://github.com/Cloudef/wlc) 52* [wlc](https://github.com/Cloudef/wlc)
53* wayland 53* wayland
54* xwayland 54* xwayland
@@ -70,11 +70,9 @@ _\*\*Richiesto solo per swaylock_
70 70
71Esegui questi comandi: 71Esegui questi comandi:
72 72
73 mkdir build 73 meson build
74 cd build 74 ninja -C build
75 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 75 sudo ninja -C build install
76 make
77 sudo make install
78 76
79Per i sistemi con logind, devi impostare un paio di caps sull'eseguibile: 77Per i sistemi con logind, devi impostare un paio di caps sull'eseguibile:
80 78
diff --git a/README.ja.md b/README.ja.md
index 2e8f9bfb..cf89971c 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -38,7 +38,7 @@ Swayã¯æ²¢å±±ã®ãƒ‡ã‚£ã‚¹ãƒˆãƒªãƒ“ューションã§æä¾›ã•ã‚Œã¦ã„ã¾ã™ã€‚"
38 38
39次ã®ä¾å­˜ãƒ‘ッケージをインストールã—ã¦ãã ã•ã„: 39次ã®ä¾å­˜ãƒ‘ッケージをインストールã—ã¦ãã ã•ã„:
40 40
41* cmake 41* meson
42* [wlc](https://github.com/Cloudef/wlc) 42* [wlc](https://github.com/Cloudef/wlc)
43* wayland 43* wayland
44* xwayland 44* xwayland
@@ -60,11 +60,9 @@ _\*\*swaylockã§ã®ã¿å¿…è¦ã§ã™_
60 60
61次ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã—ã¦ãã ã•ã„: 61次ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã—ã¦ãã ã•ã„:
62 62
63 mkdir build 63 meson build
64 cd build 64 ninja -C build
65 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 65 sudo ninja -C build install
66 make
67 sudo make install
68 66
69logindを使用ã—ã¦ã„るシステムã§ã¯ã€ãƒã‚¤ãƒŠãƒªã«ã„ãã¤ã‹ã®ã‚±ãƒ¼ãƒ‘ビリティを設定ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™: 67logindを使用ã—ã¦ã„るシステムã§ã¯ã€ãƒã‚¤ãƒŠãƒªã«ã„ãã¤ã‹ã®ã‚±ãƒ¼ãƒ‘ビリティを設定ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™:
70 68
diff --git a/README.md b/README.md
index 215cee4f..cfe51346 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ channel or shoot an email to sir@cmpwn.com for advice.
53 53
54Install dependencies: 54Install dependencies:
55 55
56* cmake 56* meson
57* [wlroots](https://github.com/swaywm/wlroots) 57* [wlroots](https://github.com/swaywm/wlroots)
58* wayland 58* wayland
59* xwayland 59* xwayland
@@ -78,11 +78,9 @@ _\*\*\*Only required for tray support_
78 78
79Run these commands: 79Run these commands:
80 80
81 mkdir build 81 meson build
82 cd build 82 ninja -C build
83 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 83 sudo ninja -C build install
84 make
85 sudo make install
86 84
87On systems with logind, you need to set a few caps on the binary: 85On systems with logind, you need to set a few caps on the binary:
88 86
diff --git a/README.pt.md b/README.pt.md
index b5ca132f..ff51ac2c 100644
--- a/README.pt.md
+++ b/README.pt.md
@@ -54,7 +54,7 @@ visite o canal no IRC ou mande um email para sir@cmpwn.com (*em inglês*).
54 54
55Antes de iniciar a compilação, instale as dependências: 55Antes de iniciar a compilação, instale as dependências:
56 56
57* cmake 57* meson
58* [wlc](https://github.com/Cloudef/wlc) 58* [wlc](https://github.com/Cloudef/wlc)
59* wayland 59* wayland
60* xwayland 60* xwayland
@@ -76,11 +76,9 @@ _\*\*Dependência apenas de swaylock_
76 76
77Para compilar, execute estes comandos: 77Para compilar, execute estes comandos:
78 78
79 mkdir build 79 meson build
80 cd build 80 ninja -C build
81 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 81 sudo ninja -C build install
82 make
83 sudo make install
84 82
85Em sistemas com logind, configure as seguintes capacidades para o arquivo binário: 83Em sistemas com logind, configure as seguintes capacidades para o arquivo binário:
86 84
diff --git a/README.ru.md b/README.ru.md
index 4035b0fc..12890d2d 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -47,7 +47,7 @@ Sway доÑтупен во многих диÑтрибутивах и наход
47 47
48УÑтановите Ñледующие пакеты: 48УÑтановите Ñледующие пакеты:
49 49
50* cmake 50* meson
51* [wlc](https://github.com/Cloudef/wlc) 51* [wlc](https://github.com/Cloudef/wlc)
52* wayland 52* wayland
53* xwayland 53* xwayland
@@ -69,11 +69,9 @@ _\*\*ТребуетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ Ð´Ð»Ñ swaylock_
69 69
70Выполните Ñледующие команды: 70Выполните Ñледующие команды:
71 71
72 mkdir build 72 meson build
73 cd build 73 ninja -C build
74 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 74 sudo ninja -C build install
75 make
76 sudo make install
77 75
78ЕÑли у Ð²Ð°Ñ logind: 76ЕÑли у Ð²Ð°Ñ logind:
79 77
diff --git a/README.uk.md b/README.uk.md
index 2e107afc..37a33e4c 100644
--- a/README.uk.md
+++ b/README.uk.md
@@ -54,7 +54,7 @@ Sway доÑтупний у багатьох диÑтрибутивах Linux (а
54 54
55Ð’Ñтановіть залежноÑÑ‚Ñ–: 55Ð’Ñтановіть залежноÑÑ‚Ñ–:
56 56
57* cmake 57* meson
58* [wlc](https://github.com/Cloudef/wlc) 58* [wlc](https://github.com/Cloudef/wlc)
59* wayland 59* wayland
60* xwayland 60* xwayland
@@ -76,11 +76,9 @@ _\*\*Лише Ð´Ð»Ñ swaylock_
76 76
77Виконайте ці команди: 77Виконайте ці команди:
78 78
79 mkdir build 79 meson build
80 cd build 80 ninja -C build
81 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SYSCONFDIR=/etc .. 81 sudo ninja -C build install
82 make
83 sudo make install
84 82
85Ðа ÑиÑтемах **з** logind, варто вÑтановити декілька можливоÑтей (caps) 83Ðа ÑиÑтемах **з** logind, варто вÑтановити декілька можливоÑтей (caps)
86на виконуваний файл sway: 84на виконуваний файл sway:
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
deleted file mode 100644
index 4fa71f3a..00000000
--- a/common/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
1include_directories(
2 ${WLC_INCLUDE_DIRS}
3 ${XKBCOMMON_INCLUDE_DIRS}
4)
5
6add_library(sway-common STATIC
7 ipc-client.c
8 list.c
9 log.c
10 util.c
11 readline.c
12 stringop.c
13)
14
15target_link_libraries(sway-common m)
diff --git a/common/meson.build b/common/meson.build
new file mode 100644
index 00000000..3a4282ad
--- /dev/null
+++ b/common/meson.build
@@ -0,0 +1,11 @@
1lib_sway_common = static_library('sway-common',
2 files(
3 'log.c',
4 'list.c',
5 'util.c',
6 'stringop.c',
7 'readline.c',
8 'ipc-client.c'
9 ),
10 include_directories: sway_inc
11)
diff --git a/completions/zsh/CMakeLists.txt b/completions/zsh/CMakeLists.txt
deleted file mode 100644
index 62c85090..00000000
--- a/completions/zsh/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
1install(
2 FILES _sway _swaymsg _swaygrab _swaylock
3 DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/zsh/site-functions/
4)
diff --git a/config.in b/config.in
index b39a39aa..086b66dc 100644
--- a/config.in
+++ b/config.in
@@ -21,7 +21,7 @@ set $menu dmenu_run
21### Output configuration 21### Output configuration
22# 22#
23# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/) 23# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
24output * bg __DATADIR__/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill 24output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
25# 25#
26# Example configuration: 26# Example configuration:
27# 27#
@@ -194,4 +194,4 @@ bar {
194 } 194 }
195} 195}
196 196
197include __SYSCONFDIR__/sway/config.d/* 197include @sysconfdir@/sway/config.d/*
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..695e237e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,147 @@
1project(
2 'sway',
3 'c',
4 license: 'MIT',
5 default_options: [
6 'c_std=c11',
7 'warning_level=2',
8 'werror=true',
9 ],
10)
11
12add_project_arguments('-Wno-unused-parameter', language: 'c')
13
14cc = meson.get_compiler('c')
15
16is_freebsd = host_machine.system().startswith('freebsd')
17datadir = get_option('datadir')
18sysconfdir = get_option('sysconfdir')
19prefix = get_option('prefix')
20
21jsonc = dependency('json-c', version: '>=0.12.1')
22pcre = dependency('libpcre')
23wlroots = dependency('wlroots')
24wayland_server = dependency('wayland-server')
25wayland_client = dependency('wayland-client')
26wayland_egl = dependency('wayland-egl')
27wayland_protos = dependency('wayland-protocols')
28xkbcommon = dependency('xkbcommon')
29pango = dependency('pango')
30pixman = dependency('pixman-1')
31libcap = dependency('libcap')
32math = cc.find_library('m')
33git = find_program('git', required: false)
34a2x = find_program('a2x', required: false)
35
36if a2x.found()
37 mandir = get_option('mandir')
38 man_files = [
39 'sway/sway.1.txt',
40 'sway/sway.5.txt',
41 'sway/sway-bar.5.txt',
42 'sway/sway-input.5.txt',
43 'sway/sway-security.7.txt',
44 'swaymsg/swaymsg.1.txt',
45 ]
46 foreach filename : man_files
47 topic = filename.split('.')[-3].split('/')[-1]
48 section = filename.split('.')[-2]
49
50 custom_target(
51 'man-@0@-@1@'.format(topic, section),
52 input: filename,
53 output: '@BASENAME@',
54 command: [
55 a2x,
56 '--no-xmllint',
57 '--doctype', 'manpage',
58 '--format', 'manpage',
59 '--destination-dir', meson.current_build_dir(),
60 '@INPUT@'
61 ],
62 install: true,
63 install_dir: '@0@/man@1@'.format(mandir, section)
64 )
65 endforeach
66endif
67
68version = get_option('sway_version')
69if version != ''
70 version = '"@0@"'.format(version)
71else
72 if not git.found()
73 error('git is required to make the version string')
74 endif
75
76 git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
77 git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
78 version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
79endif
80add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
81
82sway_inc = include_directories('include')
83
84subdir('common')
85subdir('sway')
86subdir('swaymsg')
87
88config = configuration_data()
89config.set('sysconfdir', join_paths(prefix, sysconfdir))
90config.set('datadir', join_paths(prefix, datadir))
91config.set('prefix', prefix)
92
93configure_file(
94 configuration: config,
95 input: 'config.in',
96 output: '@BASENAME@',
97 install_dir: sysconfdir + '/sway'
98)
99
100if is_freebsd
101 configure_file(
102 configuration: config,
103 input: 'security.d/10-freebsd.in',
104 output: '@BASENAME@',
105 install_dir: sysconfdir + '/sway/security.d'
106 )
107else
108 configure_file(
109 configuration: config,
110 input: 'security.d/00-defaults.in',
111 output: '@BASENAME@',
112 install_dir: sysconfdir + '/sway/security.d'
113 )
114endif
115
116install_data(
117 'sway.desktop',
118 install_dir: datadir + '/wayland-sessions'
119)
120
121if (get_option('default_wallpaper'))
122 wallpaper_files = files(
123 'assets/Sway_Wallpaper_Blue_768x1024.png',
124 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png',
125 'assets/Sway_Wallpaper_Blue_1136x640.png',
126 'assets/Sway_Wallpaper_Blue_1136x640_Portrait.png',
127 'assets/Sway_Wallpaper_Blue_1366x768.png',
128 'assets/Sway_Wallpaper_Blue_1920x1080.png',
129 'assets/Sway_Wallpaper_Blue_2048x1536.png',
130 'assets/Sway_Wallpaper_Blue_2048x1536_Portrait.png',
131 )
132 wallpaper_install_dir = datadir + '/backgrounds/sway'
133
134 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
135endif
136
137if (get_option('zsh_completions'))
138 zsh_files = files(
139 'completions/zsh/_sway',
140 'completions/zsh/_swaygrab',
141 'completions/zsh/_swaylock',
142 'completions/zsh/_swaymsg',
143 )
144 zsh_install_dir = datadir + '/zsh/site-functions'
145
146 install_data(zsh_files, install_dir: zsh_install_dir)
147endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..541ccf13
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,3 @@
1option('sway_version', type : 'string', description: 'The version string reported in `sway --version`.')
2option('default_wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.')
3option('zsh_completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt
deleted file mode 100644
index 8d8e58ad..00000000
--- a/protocols/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
1include(Wayland)
2
3WAYLAND_ADD_PROTOCOL_CLIENT(proto-client-xdg-shell
4 xdg-shell.xml
5 xdg-shell
6)
7WAYLAND_ADD_PROTOCOL_CLIENT(proto-client-desktop-shell
8 desktop-shell.xml
9 desktop-shell
10)
11WAYLAND_ADD_PROTOCOL_SERVER(proto-server-desktop-shell
12 desktop-shell.xml
13 desktop-shell
14)
15
16WAYLAND_ADD_PROTOCOL_CLIENT(proto-client-swaylock
17 swaylock.xml
18 swaylock
19)
20WAYLAND_ADD_PROTOCOL_SERVER(proto-server-swaylock
21 swaylock.xml
22 swaylock
23)
24
25WAYLAND_ADD_PROTOCOL_SERVER(proto-server-gamma-control
26 gamma-control.xml
27 gamma-control
28)
29
30WAYLAND_ADD_PROTOCOL_SERVER(proto-server-server-decoration
31 server-decoration.xml
32 server-decoration
33)
34
35add_library(sway-protocols STATIC
36 ${proto-client-xdg-shell}
37 ${proto-client-desktop-shell}
38 ${proto-server-desktop-shell}
39 ${proto-client-swaylock}
40 ${proto-server-swaylock}
41 ${proto-server-gamma-control}
42 ${proto-server-server-decoration}
43 )
44
45set(PROTOCOLS_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/protocols PARENT_SCOPE)
46INCLUDE_DIRECTORIES(${WAYLAND_INCLUDE_DIR} ${XKBCOMMON_INCLUDE_DIRS})
diff --git a/security.d/00-defaults.in b/security.d/00-defaults.in
index 05098dea..e4626477 100644
--- a/security.d/00-defaults.in
+++ b/security.d/00-defaults.in
@@ -6,17 +6,17 @@
6# installation. 6# installation.
7# 7#
8# DO NOT CHANGE THIS FILE. Override these defaults by writing new files in 8# DO NOT CHANGE THIS FILE. Override these defaults by writing new files in
9# __SYSCONFDIR__/sway/security.d/* 9# @sysconfdir@/sway/security.d/*
10 10
11# Configures enabled compositor features for specific programs 11# Configures enabled compositor features for specific programs
12permit * fullscreen keyboard mouse 12permit * fullscreen keyboard mouse
13permit __PREFIX__/bin/swaylock lock 13permit @prefix@/bin/swaylock lock
14permit __PREFIX__/bin/swaybg background 14permit @prefix@/bin/swaybg background
15permit __PREFIX__/bin/swaygrab screenshot 15permit @prefix@/bin/swaygrab screenshot
16permit __PREFIX__/bin/swaybar panel 16permit @prefix@/bin/swaybar panel
17 17
18# Configures enabled IPC features for specific programs 18# Configures enabled IPC features for specific programs
19ipc __PREFIX__/bin/swaymsg { 19ipc @prefix@/bin/swaymsg {
20 * enabled 20 * enabled
21 21
22 events { 22 events {
@@ -24,7 +24,7 @@ ipc __PREFIX__/bin/swaymsg {
24 } 24 }
25} 25}
26 26
27ipc __PREFIX__/bin/swaybar { 27ipc @prefix@/bin/swaybar {
28 bar-config enabled 28 bar-config enabled
29 outputs enabled 29 outputs enabled
30 workspaces enabled 30 workspaces enabled
@@ -36,12 +36,12 @@ ipc __PREFIX__/bin/swaybar {
36 } 36 }
37} 37}
38 38
39ipc __PREFIX__/bin/swaygrab { 39ipc @prefix@/bin/swaygrab {
40 outputs enabled 40 outputs enabled
41 tree enabled 41 tree enabled
42} 42}
43 43
44ipc __PREFIX__/bin/swaylock { 44ipc @prefix@/bin/swaylock {
45 outputs enabled 45 outputs enabled
46} 46}
47 47
diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt
deleted file mode 100644
index 274fcc4a..00000000
--- a/sway/CMakeLists.txt
+++ /dev/null
@@ -1,96 +0,0 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${WLR_INCLUDE_DIRS}
4 ${PCRE_INCLUDE_DIRS}
5 ${JSONC_INCLUDE_DIRS}
6 ${XKBCOMMON_INCLUDE_DIRS}
7 ${LIBINPUT_INCLUDE_DIRS}
8 ${CAIRO_INCLUDE_DIRS}
9 ${PANGO_INCLUDE_DIRS}
10 ${WAYLAND_INCLUDE_DIR}
11)
12
13add_executable(sway
14 desktop/output.c
15 desktop/xdg_shell_v6.c
16
17 commands.c
18 commands/exit.c
19
20 tree/container.c
21 tree/layout.c
22 tree/workspace.c
23
24 base64.c
25 main.c
26 server.c
27 ipc-json.c
28 ipc-server.c
29)
30
31add_definitions(
32 -DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}"
33)
34
35target_link_libraries(sway
36 sway-common
37 sway-protocols
38 sway-wayland
39 ${WLR_LIBRARIES}
40 ${XKBCOMMON_LIBRARIES}
41 ${PCRE_LIBRARIES}
42 ${JSONC_LIBRARIES}
43 ${WAYLAND_SERVER_LIBRARIES}
44 ${LIBINPUT_LIBRARIES}
45 ${PANGO_LIBRARIES}
46 ${JSONC_LIBRARIES}
47 m
48)
49
50if (CMAKE_SYSTEM_NAME STREQUAL Linux)
51 target_link_libraries(sway cap)
52endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
53
54install(
55 TARGETS sway
56 RUNTIME
57 DESTINATION bin
58 COMPONENT runtime
59)
60
61add_custom_target(configs ALL)
62
63function(add_config name source destination)
64 add_custom_command(
65 OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
66 COMMAND sed -r
67 's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g\; s?__DATADIR__?${CMAKE_INSTALL_FULL_DATADIR}?g'
68 ${PROJECT_SOURCE_DIR}/${source}.in > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
69 DEPENDS ${PROJECT_SOURCE_DIR}/${source}.in
70 COMMENT "Generating config file ${source}"
71 )
72
73 install(
74 FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
75 DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${destination}
76 COMPONENT configuration
77 )
78
79 add_custom_target(config-${name} DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
80 add_dependencies(configs config-${name})
81endfunction()
82
83add_config(config config sway)
84add_config(00-defaults security.d/00-defaults sway/security.d)
85
86if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
87 add_config(10-freebsd security.d/10-freebsd sway/security.d)
88endif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
89
90if (A2X_FOUND)
91 add_manpage(sway 1)
92 add_manpage(sway 5)
93 add_manpage(sway-input 5)
94 add_manpage(sway-bar 5)
95 add_manpage(sway-security 7)
96endif()
diff --git a/sway/meson.build b/sway/meson.build
new file mode 100644
index 00000000..cf2aa913
--- /dev/null
+++ b/sway/meson.build
@@ -0,0 +1,31 @@
1sway_sources = files(
2 'main.c',
3 'server.c',
4 'commands.c',
5 'commands/exit.c',
6 'ipc-json.c',
7 'ipc-server.c',
8 'desktop/output.c',
9 'desktop/xdg_shell_v6.c',
10 'tree/container.c',
11 'tree/layout.c',
12 'tree/workspace.c',
13)
14
15sway_deps = [
16 pixman,
17 wayland_server,
18 jsonc,
19 wlroots,
20 libcap,
21 math,
22]
23
24executable(
25 'sway',
26 sway_sources,
27 include_directories: [sway_inc],
28 dependencies: sway_deps,
29 link_with: [lib_sway_common],
30 install: true
31)
diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt
deleted file mode 100644
index 48ededdd..00000000
--- a/swaybar/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${WAYLAND_INCLUDE_DIR}
4 ${CAIRO_INCLUDE_DIRS}
5 ${PANGO_INCLUDE_DIRS}
6 ${JSONC_INCLUDE_DIRS}
7 ${XKBCOMMON_INCLUDE_DIRS}
8 ${DBUS_INCLUDE_DIRS}
9)
10if (ENABLE_TRAY)
11 file(GLOB tray
12 tray/*.c
13 )
14endif()
15
16add_executable(swaybar
17 main.c
18 config.c
19 render.c
20 bar.c
21 status_line.c
22 ipc.c
23 event_loop.c
24 ${tray}
25)
26
27target_link_libraries(swaybar
28 sway-common
29 sway-wayland
30 ${WAYLAND_CLIENT_LIBRARIES}
31 ${WAYLAND_CURSOR_LIBRARIES}
32 ${CAIRO_LIBRARIES}
33 ${PANGO_LIBRARIES}
34 ${JSONC_LIBRARIES}
35 ${DBUS_LIBRARIES}
36)
37
38if (WITH_GDK_PIXBUF)
39 include_directories(
40 ${GDK_PIXBUF_INCLUDE_DIRS}
41 )
42endif()
43
44target_link_libraries(swaybar rt)
45
46install(
47 TARGETS swaybar
48 RUNTIME
49 DESTINATION bin
50 COMPONENT runtime
51)
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt
deleted file mode 100644
index f8cad404..00000000
--- a/swaybg/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${WAYLAND_INCLUDE_DIR}
4 ${CAIRO_INCLUDE_DIRS}
5 ${PANGO_INCLUDE_DIRS}
6 ${XKBCOMMON_INCLUDE_DIRS}
7)
8
9add_executable(swaybg
10 main.c
11)
12
13target_link_libraries(swaybg
14 sway-common
15 sway-wayland
16 ${WAYLAND_CLIENT_LIBRARIES}
17 ${WAYLAND_CURSOR_LIBRARIES}
18 ${CAIRO_LIBRARIES}
19 ${PANGO_LIBRARIES}
20 m
21)
22
23if (WITH_GDK_PIXBUF)
24 include_directories(
25 ${GDK_PIXBUF_INCLUDE_DIRS}
26 )
27 target_link_libraries(swaybg
28 ${GDK_PIXBUF_LIBRARIES}
29 )
30endif()
31
32install(
33 TARGETS swaybg
34 RUNTIME
35 DESTINATION bin
36 COMPONENT runtime
37)
diff --git a/swaygrab/CMakeLists.txt b/swaygrab/CMakeLists.txt
deleted file mode 100644
index 42806cae..00000000
--- a/swaygrab/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
1include_directories(
2 ${JSONC_INCLUDE_DIRS}
3 ${WLC_INCLUDE_DIRS}
4 ${XKBCOMMON_INCLUDE_DIRS}
5)
6
7add_executable(swaygrab
8 main.c
9 json.c
10)
11
12target_link_libraries(swaygrab
13 sway-common
14 ${JSONC_LIBRARIES}
15 rt
16 m
17)
18
19install(
20 TARGETS swaygrab
21 RUNTIME
22 DESTINATION bin
23 COMPONENT runtime
24)
25
26if (A2X_FOUND)
27 add_manpage(swaygrab 1)
28endif()
diff --git a/swaylock/CMakeLists.txt b/swaylock/CMakeLists.txt
deleted file mode 100644
index 90b54a72..00000000
--- a/swaylock/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${WAYLAND_INCLUDE_DIR}
4 ${CAIRO_INCLUDE_DIRS}
5 ${PANGO_INCLUDE_DIRS}
6 ${PAM_INCLUDE_DIRS}
7 ${JSONC_INCLUDE_DIRS}
8 ${XKBCOMMON_INCLUDE_DIRS}
9)
10
11add_executable(swaylock
12 main.c
13)
14
15target_link_libraries(swaylock
16 sway-common
17 sway-wayland
18 ${WAYLAND_CLIENT_LIBRARIES}
19 ${WAYLAND_CURSOR_LIBRARIES}
20 ${CAIRO_LIBRARIES}
21 ${PANGO_LIBRARIES}
22 ${PAM_LIBRARIES}
23 ${JSONC_LIBRARIES}
24 m
25)
26
27if (WITH_GDK_PIXBUF)
28 include_directories(
29 ${GDK_PIXBUF_INCLUDE_DIRS}
30 )
31 target_link_libraries(swaylock
32 ${GDK_PIXBUF_LIBRARIES}
33 )
34endif()
35
36install(
37 TARGETS swaylock
38 RUNTIME
39 DESTINATION bin
40 COMPONENT runtime
41)
42
43install(
44 FILES ${CMAKE_CURRENT_SOURCE_DIR}/pam/swaylock
45 DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d/
46 COMPONENT data
47)
48
49if (A2X_FOUND)
50 add_manpage(swaylock 1)
51endif()
diff --git a/swaymsg/CMakeLists.txt b/swaymsg/CMakeLists.txt
deleted file mode 100644
index b428a409..00000000
--- a/swaymsg/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
1add_executable(swaymsg
2 main.c
3)
4
5include_directories(
6 ${JSONC_INCLUDE_DIRS}
7)
8
9target_link_libraries(swaymsg
10 sway-common
11 ${JSONC_LIBRARIES}
12)
13
14install(
15 TARGETS swaymsg
16 RUNTIME
17 DESTINATION bin
18 COMPONENT runtime
19)
20
21if (A2X_FOUND)
22 add_manpage(swaymsg 1)
23endif()
diff --git a/swaymsg/meson.build b/swaymsg/meson.build
new file mode 100644
index 00000000..2d678878
--- /dev/null
+++ b/swaymsg/meson.build
@@ -0,0 +1,8 @@
1executable(
2 'swaymsg',
3 'main.c',
4 include_directories: [sway_inc],
5 dependencies: [jsonc],
6 link_with: [lib_sway_common],
7 install: true
8)
diff --git a/wayland/CMakeLists.txt b/wayland/CMakeLists.txt
deleted file mode 100644
index 91fd7fff..00000000
--- a/wayland/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${PANGO_INCLUDE_DIRS}
4 ${XKBCOMMON_INCLUDE_DIRS}
5 ${WAYLAND_INCLUDE_DIR}
6 ${EPOLLSHIM_INCLUDE_DIRS}
7)
8
9add_library(sway-wayland STATIC
10 buffers.c
11 pango.c
12 registry.c
13 window.c
14 cairo.c
15 )
16
17target_link_libraries(sway-wayland
18 sway-common
19 sway-protocols
20 ${PANGO_LIBRARIES}
21 ${XKBCOMMON_LIBRARIES}
22 ${EPOLLSHIM_LIBRARIES}
23 )
24
25if (WITH_GDK_PIXBUF)
26 include_directories(
27 ${GDK_PIXBUF_INCLUDE_DIRS}
28 )
29 target_link_libraries(sway-wayland
30 ${GDK_PIXBUF_LIBRARIES}
31 )
32endif()