diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index dc521570..00000000 --- a/CMakeLists.txt +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | cmake_minimum_required(VERSION 3.1.0) | ||
2 | |||
3 | project(sway C) | ||
4 | |||
5 | add_compile_options(-g) | ||
6 | set(CMAKE_C_STANDARD 99) | ||
7 | set(CMAKE_C_EXTENSIONS OFF) | ||
8 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
9 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) | ||
10 | add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) | ||
11 | |||
12 | # Add Address Sanitiezed build type | ||
13 | set(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 ) | ||
17 | mark_as_advanced( | ||
18 | CMAKE_C_FLAGS_ASAN | ||
19 | CMAKE_EXE_LINKER_FLAGS_DEBUG | ||
20 | CMAKE_SHARED_LINKER_FLAGS_DEBUG | ||
21 | ) | ||
22 | |||
23 | list(INSERT CMAKE_MODULE_PATH 0 | ||
24 | ${CMAKE_CURRENT_SOURCE_DIR}/CMake | ||
25 | ) | ||
26 | |||
27 | if (VERSION) | ||
28 | add_definitions(-DSWAY_VERSION=\"${VERSION}\") | ||
29 | else() | ||
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}\\\")\"") | ||
45 | endif() | ||
46 | |||
47 | option(enable-swaylock "Enables the swaylock utility" YES) | ||
48 | option(enable-swaybg "Enables the wallpaper utility" YES) | ||
49 | option(enable-swaybar "Enables the swaybar utility" YES) | ||
50 | option(enable-swaygrab "Enables the swaygrab utility" YES) | ||
51 | option(enable-swaymsg "Enables the swaymsg utility" YES) | ||
52 | option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES) | ||
53 | option(enable-tray "Enables the swaybar tray" YES) | ||
54 | option(zsh-completions "Zsh shell completions" NO) | ||
55 | option(default-wallpaper "Installs the default wallpaper" YES) | ||
56 | option(LD_LIBRARY_PATH "Configure sway's default LD_LIBRARY_PATH") | ||
57 | |||
58 | if (LD_LIBRARY_PATH) | ||
59 | add_definitions(-D_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}") | ||
60 | endif() | ||
61 | |||
62 | find_package(JsonC 0.12.1 REQUIRED) | ||
63 | find_package(PCRE REQUIRED) | ||
64 | find_package(WLC REQUIRED) | ||
65 | find_package(Wayland REQUIRED) | ||
66 | find_package(XKBCommon REQUIRED) | ||
67 | find_package(Cairo REQUIRED) | ||
68 | find_package(Pango REQUIRED) | ||
69 | find_package(GdkPixbuf) | ||
70 | find_package(PAM) | ||
71 | find_package(DBus 1.10) | ||
72 | |||
73 | find_package(LibInput REQUIRED) | ||
74 | |||
75 | if (CMAKE_SYSTEM_NAME STREQUAL Linux) | ||
76 | find_package(Libcap REQUIRED) | ||
77 | endif (CMAKE_SYSTEM_NAME STREQUAL Linux) | ||
78 | |||
79 | if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) | ||
80 | find_package(EpollShim REQUIRED) | ||
81 | endif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) | ||
82 | |||
83 | include(FeatureSummary) | ||
84 | include(Manpage) | ||
85 | include(GNUInstallDirs) | ||
86 | |||
87 | if (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() | ||
94 | else() | ||
95 | message(STATUS "Building without gdk-pixbuf, only png images supported.") | ||
96 | endif() | ||
97 | |||
98 | if (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() | ||
105 | else() | ||
106 | message(STATUS "Building without the tray.") | ||
107 | endif() | ||
108 | |||
109 | include_directories(include) | ||
110 | |||
111 | add_subdirectory(protocols) | ||
112 | add_subdirectory(common) | ||
113 | add_subdirectory(wayland) | ||
114 | |||
115 | add_subdirectory(sway) | ||
116 | if(enable-swaybg) | ||
117 | if(CAIRO_FOUND AND PANGO_FOUND) | ||
118 | add_subdirectory(swaybg) | ||
119 | else() | ||
120 | message(WARNING "Not building swaybg - cairo, and pango are required.") | ||
121 | endif() | ||
122 | endif() | ||
123 | if(enable-swaymsg) | ||
124 | add_subdirectory(swaymsg) | ||
125 | endif() | ||
126 | if(enable-swaygrab) | ||
127 | add_subdirectory(swaygrab) | ||
128 | endif() | ||
129 | if(enable-swaybar) | ||
130 | if(CAIRO_FOUND AND PANGO_FOUND) | ||
131 | add_subdirectory(swaybar) | ||
132 | else() | ||
133 | message(WARNING "Not building swaybar - cairo, and pango are required.") | ||
134 | endif() | ||
135 | endif() | ||
136 | if(enable-swaylock) | ||
137 | if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND) | ||
138 | add_subdirectory(swaylock) | ||
139 | else() | ||
140 | message(WARNING "Not building swaylock - cairo, pango, and PAM are required.") | ||
141 | endif() | ||
142 | endif() | ||
143 | if(zsh-completions) | ||
144 | add_subdirectory(completions/zsh) | ||
145 | endif() | ||
146 | install( | ||
147 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop | ||
148 | DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/wayland-sessions | ||
149 | COMPONENT data | ||
150 | ) | ||
151 | |||
152 | if(default-wallpaper) | ||
153 | install( | ||
154 | DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets/ | ||
155 | DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/backgrounds/sway | ||
156 | COMPONENT data | ||
157 | FILES_MATCHING PATTERN "*Wallpaper*" | ||
158 | ) | ||
159 | endif() | ||
160 | |||
161 | feature_summary(WHAT ALL) | ||