2022-08-06 22:15:00 +01:00
|
|
|
# Feynman -- Wayland compositor for GNU Emacs
|
|
|
|
#
|
|
|
|
# Copyright (c) 2022 Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, version 2.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2022-08-21 12:39:49 +01:00
|
|
|
|
2022-08-23 14:51:10 +01:00
|
|
|
add_executable(feynman-wm
|
|
|
|
main.c
|
|
|
|
compositor.c)
|
2022-08-06 22:15:00 +01:00
|
|
|
|
2022-08-23 14:51:10 +01:00
|
|
|
set_target_properties(feynman-wm PROPERTIES
|
2022-08-06 22:15:00 +01:00
|
|
|
VERSION ${PROJECT_VERSION}
|
|
|
|
# Warn on unused libs
|
|
|
|
LINK_WHAT_YOU_USE TRUE
|
|
|
|
C_INCLUDE_WHAT_YOU_USE "${iwyu_path}"
|
|
|
|
|
|
|
|
# LTO support
|
|
|
|
INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
|
|
|
|
|
|
if(FEYNMAN_ENABLE_TIDY)
|
2022-08-23 14:51:10 +01:00
|
|
|
set_target_properties(feynman-wm PROPERTIES C_CLANG_TIDY ${CLANG_TIDY_PATH})
|
2022-08-06 22:15:00 +01:00
|
|
|
endif()
|
|
|
|
|
2022-08-23 14:51:10 +01:00
|
|
|
target_include_directories(feynman-wm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2022-08-06 22:15:00 +01:00
|
|
|
|
2022-08-07 11:07:08 +01:00
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots)
|
2022-08-23 14:51:10 +01:00
|
|
|
pkg_check_modules(DEPS REQUIRED IMPORTED_TARGET
|
|
|
|
wayland-server
|
|
|
|
wayland-client
|
|
|
|
wayland-cursor
|
|
|
|
wayland-protocols
|
|
|
|
xkbcommon
|
|
|
|
libinput
|
|
|
|
xcb)
|
|
|
|
|
|
|
|
include_directories(SYSTEM ${WLROOTS_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
2022-08-07 11:07:08 +01:00
|
|
|
|
2022-08-23 14:51:10 +01:00
|
|
|
target_link_libraries(feynman-wm Threads::Threads PkgConfig::WLROOTS PkgConfig::DEPS)
|
2022-08-21 12:39:49 +01:00
|
|
|
|
|
|
|
# find Wayland protocols
|
|
|
|
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
|
|
|
|
|
|
|
|
# find 'wayland-scanner' executable
|
|
|
|
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
|
|
|
|
|
|
|
|
set(XDG_PROT_DEF "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml")
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.h
|
|
|
|
COMMAND ${WAYLAND_SCANNER} client-header ${XDG_PROT_DEF} xdg-shell-protocol.h)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.c
|
|
|
|
COMMAND ${WAYLAND_SCANNER} private-code ${XDG_PROT_DEF} xdg-shell-protocol.c
|
|
|
|
DEPENDS xdg-shell-protocol.h)
|
|
|
|
|
2022-08-23 14:51:10 +01:00
|
|
|
target_include_directories(feynman-wm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
target_sources(feynman-wm PRIVATE xdg-shell-protocol.c)
|
2022-08-21 12:39:49 +01:00
|
|
|
include_directories(SYSTEM ${WLROOTS_INCLUDE_DIRS})
|