diff options
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | common/CMakeLists.txt | 7 | ||||
-rw-r--r-- | protocols/CMakeLists.txt | 22 | ||||
-rw-r--r-- | sway/CMakeLists.txt | 38 | ||||
-rw-r--r-- | swaybar/CMakeLists.txt | 28 | ||||
-rw-r--r-- | swaybg/CMakeLists.txt | 28 | ||||
-rw-r--r-- | swaygrab/CMakeLists.txt | 7 | ||||
-rw-r--r-- | swaymsg/CMakeLists.txt | 10 | ||||
-rw-r--r-- | wayland/CMakeLists.txt | 17 |
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}\") | |||
41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) | 41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) |
42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") | 42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") |
43 | 43 | ||
44 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) | 44 | find_package(Cairo REQUIRED) |
45 | find_package(JsonC REQUIRED) | ||
46 | find_package(PCRE REQUIRED) | ||
47 | find_package(Pango REQUIRED) | ||
48 | find_package(WLC REQUIRED) | ||
49 | find_package(Wayland REQUIRED) | ||
50 | find_package(XKBCommon REQUIRED) | ||
51 | |||
52 | include_directories(include) | ||
53 | |||
54 | add_subdirectory(protocols) | ||
55 | add_subdirectory(common) | ||
56 | add_subdirectory(wayland) | ||
45 | 57 | ||
46 | add_subdirectory(sway) | 58 | add_subdirectory(sway) |
47 | add_subdirectory(swaybg) | 59 | add_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 @@ | |||
1 | add_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 @@ | |||
1 | include(Wayland) | ||
2 | |||
3 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-client-xdg-shell | ||
4 | xdg-shell.xml | ||
5 | xdg-shell | ||
6 | ) | ||
7 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-client-desktop-shell | ||
8 | desktop-shell.xml | ||
9 | desktop-shell | ||
10 | ) | ||
11 | WAYLAND_ADD_PROTOCOL_SERVER(proto-server-desktop-shell | ||
12 | desktop-shell.xml | ||
13 | desktop-shell | ||
14 | ) | ||
15 | |||
16 | add_library(sway-protocols | ||
17 | ${proto-client-xdg-shell} | ||
18 | ${proto-client-desktop-shell} | ||
19 | ${proto-server-desktop-shell} | ||
20 | ) | ||
21 | |||
22 | set(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 @@ | |||
1 | find_package(XKBCommon REQUIRED) | ||
2 | find_package(WLC REQUIRED) | ||
3 | find_package(PCRE REQUIRED) | ||
4 | find_package(Wayland REQUIRED) | ||
5 | find_package(JsonC REQUIRED) | ||
6 | |||
7 | include(Wayland) | ||
8 | WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell | ||
9 | ${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml | ||
10 | desktop-shell | ||
11 | ) | ||
12 | |||
13 | file(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) | ||
14 | file(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c) | ||
15 | |||
16 | include_directories( | 1 | include_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 | ||
24 | add_executable(sway | 9 | add_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 | ||
30 | target_link_libraries(sway | 28 | target_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 @@ | |||
1 | find_package(Wayland REQUIRED) | ||
2 | find_package(Cairo REQUIRED) | ||
3 | find_package(Pango REQUIRED) | ||
4 | |||
5 | include(Wayland) | ||
6 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell | ||
7 | ../protocols/xdg-shell.xml | ||
8 | xdg-shell | ||
9 | ) | ||
10 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell | ||
11 | ../protocols/desktop-shell.xml | ||
12 | desktop-shell | ||
13 | ) | ||
14 | |||
15 | include_directories( | 1 | include_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 | ||
22 | file(GLOB sources *.c) | ||
23 | file(GLOB common ../common/*.c) | ||
24 | file(GLOB wl_sources ../wayland/*.c) | ||
25 | |||
26 | add_executable(swaybar | 8 | add_executable(swaybar |
27 | ${sources} | 9 | main.c |
28 | ${wl_sources} | ||
29 | ${common} | ||
30 | ${proto-xdg-shell} | ||
31 | ${proto-desktop-shell} | ||
32 | ) | 10 | ) |
33 | 11 | ||
34 | target_link_libraries(swaybar | 12 | target_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 @@ | |||
1 | find_package(Wayland REQUIRED) | ||
2 | find_package(Cairo REQUIRED) | ||
3 | find_package(Pango REQUIRED) | ||
4 | |||
5 | include(Wayland) | ||
6 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell | ||
7 | ../protocols/xdg-shell.xml | ||
8 | xdg-shell | ||
9 | ) | ||
10 | WAYLAND_ADD_PROTOCOL_CLIENT(proto-desktop-shell | ||
11 | ../protocols/desktop-shell.xml | ||
12 | desktop-shell | ||
13 | ) | ||
14 | |||
15 | include_directories( | 1 | include_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 | ||
22 | file(GLOB sources *.c) | ||
23 | file(GLOB common ../common/*.c) | ||
24 | file(GLOB wl_sources ../wayland/*.c) | ||
25 | |||
26 | add_executable(swaybg | 8 | add_executable(swaybg |
27 | ${sources} | 9 | main.c |
28 | ${wl_sources} | ||
29 | ${common} | ||
30 | ${proto-xdg-shell} | ||
31 | ${proto-desktop-shell} | ||
32 | ) | 10 | ) |
33 | 11 | ||
34 | target_link_libraries(swaybg | 12 | target_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 @@ | |||
1 | file(GLOB sources *.c) | ||
2 | file(GLOB common ../common/*.c) | ||
3 | |||
4 | add_executable(swaygrab | 1 | add_executable(swaygrab |
5 | ${sources} | 2 | main.c |
6 | ${common} | ||
7 | ) | 3 | ) |
8 | 4 | ||
9 | target_link_libraries(swaygrab | 5 | target_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 @@ | |||
1 | file(GLOB sources *.c) | ||
2 | file(GLOB common ../common/*.c) | ||
3 | |||
4 | add_executable(swaymsg | 1 | add_executable(swaymsg |
5 | ${sources} | 2 | main.c |
6 | ${common} | ||
7 | ) | 3 | ) |
8 | 4 | ||
5 | target_link_libraries(swaymsg | ||
6 | sway-common | ||
7 | ) | ||
8 | |||
9 | install( | 9 | install( |
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 @@ | |||
1 | include_directories( | ||
2 | ${PROTOCOLS_INCLUDE_DIRS} | ||
3 | ${PANGO_INCLUDE_DIRS} | ||
4 | ) | ||
5 | |||
6 | add_library(sway-wayland | ||
7 | buffers.c | ||
8 | pango.c | ||
9 | registry.c | ||
10 | window.c | ||
11 | ) | ||
12 | |||
13 | target_link_libraries(sway-wayland | ||
14 | sway-common | ||
15 | sway-protocols | ||
16 | ${PANGO_LIBRARIES} | ||
17 | ) | ||