summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt161
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 @@
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(WLC 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 add_subdirectory(swaybg)
119 else()
120 message(WARNING "Not building swaybg - cairo, and pango are required.")
121 endif()
122endif()
123if(enable-swaymsg)
124 add_subdirectory(swaymsg)
125endif()
126if(enable-swaygrab)
127 add_subdirectory(swaygrab)
128endif()
129if(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()
135endif()
136if(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()
142endif()
143if(zsh-completions)
144 add_subdirectory(completions/zsh)
145endif()
146install(
147 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
148 DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/wayland-sessions
149 COMPONENT data
150 )
151
152if(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 )
159endif()
160
161feature_summary(WHAT ALL)