aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt14
-rw-r--r--common/CMakeLists.txt7
-rw-r--r--protocols/CMakeLists.txt22
-rw-r--r--sway/CMakeLists.txt38
-rw-r--r--swaybar/CMakeLists.txt28
-rw-r--r--swaybg/CMakeLists.txt28
-rw-r--r--swaygrab/CMakeLists.txt7
-rw-r--r--swaymsg/CMakeLists.txt10
-rw-r--r--wayland/CMakeLists.txt17
9 files changed, 93 insertions, 78 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9a2e37d..75c61c2a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,19 @@ add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\")
41string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) 41string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
42add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") 42add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\")
43 43
44include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 44find_package(Cairo REQUIRED)
45find_package(JsonC REQUIRED)
46find_package(PCRE REQUIRED)
47find_package(Pango REQUIRED)
48find_package(WLC REQUIRED)
49find_package(Wayland REQUIRED)
50find_package(XKBCommon REQUIRED)
51
52include_directories(include)
53
54add_subdirectory(protocols)
55add_subdirectory(common)
56add_subdirectory(wayland)
45 57
46add_subdirectory(sway) 58add_subdirectory(sway)
47add_subdirectory(swaybg) 59add_subdirectory(swaybg)
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
new file mode 100644
index 00000000..f7d44ec5
--- /dev/null
+++ b/common/CMakeLists.txt
@@ -0,0 +1,7 @@
1add_library(sway-common
2 ipc-client.c
3 list.c
4 log.c
5 readline.c
6 stringop.c
7 )
diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt
new file mode 100644
index 00000000..07becc36
--- /dev/null
+++ b/protocols/CMakeLists.txt
@@ -0,0 +1,22 @@
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
16add_library(sway-protocols
17 ${proto-client-xdg-shell}
18 ${proto-client-desktop-shell}
19 ${proto-server-desktop-shell}
20 )
21
22set(PROTOCOLS_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/protocols PARENT_SCOPE)
diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt
index 92392354..49ed24e7 100644
--- a/sway/CMakeLists.txt
+++ b/sway/CMakeLists.txt
@@ -1,33 +1,33 @@
1find_package(XKBCommon REQUIRED)
2find_package(WLC REQUIRED)
3find_package(PCRE REQUIRED)
4find_package(Wayland REQUIRED)
5find_package(JsonC REQUIRED)
6
7include(Wayland)
8WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell
9 ${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml
10 desktop-shell
11)
12
13file(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
14file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
15
16include_directories( 1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
17 ${WLC_INCLUDE_DIRS} 3 ${WLC_INCLUDE_DIRS}
18 ${PCRE_INCLUDE_DIRS} 4 ${PCRE_INCLUDE_DIRS}
19 ${JSONC_INCLUDE_DIRS} 5 ${JSONC_INCLUDE_DIRS}
20 ${XKBCOMMON_INCLUDE_DIRS} 6 ${XKBCOMMON_INCLUDE_DIRS}
21 ${CMAKE_CURRENT_BINARY_DIR}
22) 7)
23 8
24add_executable(sway 9add_executable(sway
25 ${sources} 10 commands.c
26 ${common} 11 config.c
27 ${proto-desktop-shell} 12 container.c
13 criteria.c
14 debug_log.c
15 extensions.c
16 focus.c
17 handlers.c
18 input_state.c
19 ipc-server.c
20 layout.c
21 main.c
22 output.c
23 resize.c
24 util.c
25 workspace.c
28) 26)
29 27
30target_link_libraries(sway 28target_link_libraries(sway
29 sway-common
30 sway-protocols
31 ${WLC_LIBRARIES} 31 ${WLC_LIBRARIES}
32 ${XKBCOMMON_LIBRARIES} 32 ${XKBCOMMON_LIBRARIES}
33 ${PCRE_LIBRARIES} 33 ${PCRE_LIBRARIES}
diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt
index c14b5f75..a2ff9f5a 100644
--- a/swaybar/CMakeLists.txt
+++ b/swaybar/CMakeLists.txt
@@ -1,37 +1,17 @@
1find_package(Wayland REQUIRED)
2find_package(Cairo REQUIRED)
3find_package(Pango REQUIRED)
4
5include(Wayland)
6WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell
7 ../protocols/xdg-shell.xml
8 xdg-shell
9)
10WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell
11 ../protocols/desktop-shell.xml
12 desktop-shell
13)
14
15include_directories( 1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
16 ${WAYLAND_CLIENT_INCLUDE_DIR} 3 ${WAYLAND_CLIENT_INCLUDE_DIR}
17 ${CAIRO_INCLUDE_DIRS} 4 ${CAIRO_INCLUDE_DIRS}
18 ${PANGO_INCLUDE_DIRS} 5 ${PANGO_INCLUDE_DIRS}
19 ${CMAKE_CURRENT_BINARY_DIR}
20) 6)
21 7
22file(GLOB sources *.c)
23file(GLOB common ../common/*.c)
24file(GLOB wl_sources ../wayland/*.c)
25
26add_executable(swaybar 8add_executable(swaybar
27 ${sources} 9 main.c
28 ${wl_sources}
29 ${common}
30 ${proto-xdg-shell}
31 ${proto-desktop-shell}
32) 10)
33 11
34target_link_libraries(swaybar 12target_link_libraries(swaybar
13 sway-common
14 sway-wayland
35 ${WAYLAND_CLIENT_LIBRARIES} 15 ${WAYLAND_CLIENT_LIBRARIES}
36 ${WAYLAND_CURSOR_LIBRARIES} 16 ${WAYLAND_CURSOR_LIBRARIES}
37 ${CAIRO_LIBRARIES} 17 ${CAIRO_LIBRARIES}
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt
index 9d3cc547..71363d79 100644
--- a/swaybg/CMakeLists.txt
+++ b/swaybg/CMakeLists.txt
@@ -1,37 +1,17 @@
1find_package(Wayland REQUIRED)
2find_package(Cairo REQUIRED)
3find_package(Pango REQUIRED)
4
5include(Wayland)
6WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell
7 ../protocols/xdg-shell.xml
8 xdg-shell
9)
10WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell
11 ../protocols/desktop-shell.xml
12 desktop-shell
13)
14
15include_directories( 1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
16 ${WAYLAND_CLIENT_INCLUDE_DIR} 3 ${WAYLAND_CLIENT_INCLUDE_DIR}
17 ${CAIRO_INCLUDE_DIRS} 4 ${CAIRO_INCLUDE_DIRS}
18 ${PANGO_INCLUDE_DIRS} 5 ${PANGO_INCLUDE_DIRS}
19 ${CMAKE_CURRENT_BINARY_DIR}
20) 6)
21 7
22file(GLOB sources *.c)
23file(GLOB common ../common/*.c)
24file(GLOB wl_sources ../wayland/*.c)
25
26add_executable(swaybg 8add_executable(swaybg
27 ${sources} 9 main.c
28 ${wl_sources}
29 ${common}
30 ${proto-xdg-shell}
31 ${proto-desktop-shell}
32) 10)
33 11
34target_link_libraries(swaybg 12target_link_libraries(swaybg
13 sway-common
14 sway-wayland
35 ${WAYLAND_CLIENT_LIBRARIES} 15 ${WAYLAND_CLIENT_LIBRARIES}
36 ${WAYLAND_CURSOR_LIBRARIES} 16 ${WAYLAND_CURSOR_LIBRARIES}
37 ${CAIRO_LIBRARIES} 17 ${CAIRO_LIBRARIES}
diff --git a/swaygrab/CMakeLists.txt b/swaygrab/CMakeLists.txt
index 77d96412..d5468cda 100644
--- a/swaygrab/CMakeLists.txt
+++ b/swaygrab/CMakeLists.txt
@@ -1,12 +1,9 @@
1file(GLOB sources *.c)
2file(GLOB common ../common/*.c)
3
4add_executable(swaygrab 1add_executable(swaygrab
5 ${sources} 2 main.c
6 ${common}
7) 3)
8 4
9target_link_libraries(swaygrab 5target_link_libraries(swaygrab
6 sway-common
10 rt 7 rt
11) 8)
12 9
diff --git a/swaymsg/CMakeLists.txt b/swaymsg/CMakeLists.txt
index 7616d942..2481b280 100644
--- a/swaymsg/CMakeLists.txt
+++ b/swaymsg/CMakeLists.txt
@@ -1,11 +1,11 @@
1file(GLOB sources *.c)
2file(GLOB common ../common/*.c)
3
4add_executable(swaymsg 1add_executable(swaymsg
5 ${sources} 2 main.c
6 ${common}
7) 3)
8 4
5target_link_libraries(swaymsg
6 sway-common
7 )
8
9install( 9install(
10 TARGETS swaymsg 10 TARGETS swaymsg
11 RUNTIME 11 RUNTIME
diff --git a/wayland/CMakeLists.txt b/wayland/CMakeLists.txt
new file mode 100644
index 00000000..5633dd6e
--- /dev/null
+++ b/wayland/CMakeLists.txt
@@ -0,0 +1,17 @@
1include_directories(
2 ${PROTOCOLS_INCLUDE_DIRS}
3 ${PANGO_INCLUDE_DIRS}
4)
5
6add_library(sway-wayland
7 buffers.c
8 pango.c
9 registry.c
10 window.c
11 )
12
13target_link_libraries(sway-wayland
14 sway-common
15 sway-protocols
16 ${PANGO_LIBRARIES}
17 )