diff options
author | Christoph Gysin <christoph.gysin@gmail.com> | 2015-12-02 07:57:53 +0200 |
---|---|---|
committer | Christoph Gysin <christoph.gysin@gmail.com> | 2015-12-02 12:15:57 +0200 |
commit | cce9c338c07e889aa82db806f0dddf2f997edbb6 (patch) | |
tree | 717052d8d88f3fd14d26566daa520dbdd3a452fe /swaybar | |
parent | Merge pull request #290 from christophgysin/cmake (diff) | |
download | sway-cce9c338c07e889aa82db806f0dddf2f997edbb6.tar.gz sway-cce9c338c07e889aa82db806f0dddf2f997edbb6.tar.zst sway-cce9c338c07e889aa82db806f0dddf2f997edbb6.zip |
cmake: build common code only once
This creates (static) libraries for protocols/, common/, and wayland/.
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/CMakeLists.txt | 28 |
1 files changed, 4 insertions, 24 deletions
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} |