-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
66 lines (54 loc) · 2.14 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.18)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(wl-mirror C)
# options
option(INSTALL_EXAMPLE_SCRIPTS "install wl-mirror example scripts" OFF)
option(INSTALL_DOCUMENTATION "install wl-mirror manual pages" OFF)
option(WITH_LIBDECOR "use libdecor for window decoration" OFF)
set(FORCE_WAYLAND_SCANNER_PATH "" CACHE STRING "provide a custom path for wayland-scanner")
# wayland protocols needed by wl-mirror
option(FORCE_SYSTEM_WL_PROTOCOLS "force use of system wayland-protocols" OFF)
option(FORCE_SYSTEM_WLR_PROTOCOLS "force use of system wlr-protocols" OFF)
set(WL_PROTOCOL_DIR "/usr/share/wayland-protocols/" CACHE STRING "wayland-protocols directory")
set(WLR_PROTOCOL_DIR "/usr/share/wlr-protocols/" CACHE STRING "wlr-protocols directory")
set(PROTOCOLS
"stable/xdg-shell/xdg-shell.xml"
"stable/viewporter/viewporter.xml"
"staging/fractional-scale/fractional-scale-v1.xml"
"unstable/xdg-output/xdg-output-unstable-v1.xml"
"unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml"
"unstable/wlr-export-dmabuf-unstable-v1.xml"
"unstable/wlr-screencopy-unstable-v1.xml"
)
# required dependencies
add_subdirectory(deps)
# wayland protocol wrapper generation with wayland-scanner
add_subdirectory(proto)
# shader file embedding
add_subdirectory(glsl)
# version embedding
add_subdirectory(version)
# manual pages
add_subdirectory(man)
if (${BUILD_DOCUMENTATION})
build_scdoc_man_page(wl-mirror 1)
build_scdoc_man_page(wl-present 1)
endif()
# main target
file(GLOB sources CONFIGURE_DEPENDS src/*.c)
add_executable(wl-mirror ${sources})
target_compile_options(wl-mirror PRIVATE -Wall -Wextra)
target_include_directories(wl-mirror PRIVATE include/)
target_link_libraries(wl-mirror PRIVATE deps protocols shaders version)
# installation rules
include(GNUInstallDirs)
install(TARGETS wl-mirror DESTINATION "${CMAKE_INSTALL_BINDIR}")
if (${INSTALL_EXAMPLE_SCRIPTS})
install(PROGRAMS scripts/wl-present DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
if (${INSTALL_DOCUMENTATION})
install_scdoc_man_page(wl-mirror 1)
if (${INSTALL_EXAMPLE_SCRIPTS})
install_scdoc_man_page(wl-present 1)
endif()
endif()