aboutsummaryrefslogtreecommitdiffstats
path: root/swaybg
diff options
context:
space:
mode:
authorLibravatar Christoph Gysin <christoph.gysin@gmail.com>2015-12-02 07:57:53 +0200
committerLibravatar Christoph Gysin <christoph.gysin@gmail.com>2015-12-02 12:15:57 +0200
commitcce9c338c07e889aa82db806f0dddf2f997edbb6 (patch)
tree717052d8d88f3fd14d26566daa520dbdd3a452fe /swaybg
parentMerge pull request #290 from christophgysin/cmake (diff)
downloadsway-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 'swaybg')
-rw-r--r--swaybg/CMakeLists.txt28
1 files changed, 4 insertions, 24 deletions
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}