summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--common/CMakeLists.txt3
-rw-r--r--swaybg/CMakeLists.txt4
3 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f33a3f8..00e8de6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,8 +10,6 @@ add_definitions("-Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE")
10list(INSERT CMAKE_MODULE_PATH 0 10list(INSERT CMAKE_MODULE_PATH 0
11 "${CMAKE_CURRENT_SOURCE_DIR}/CMake") 11 "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
12 12
13add_subdirectory(swaybg swaybg)
14
15if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") 13if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
16 execute_process( 14 execute_process(
17 COMMAND git describe --always 15 COMMAND git describe --always
@@ -31,6 +29,10 @@ add_definitions("-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\"")
31string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) 29string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
32add_definitions("-DSWAY_VERSION_DATE=${CURRENT_DATE}") 30add_definitions("-DSWAY_VERSION_DATE=${CURRENT_DATE}")
33 31
32include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
33add_subdirectory(common)
34add_subdirectory(swaybg)
35
34find_package(XKBCommon REQUIRED) 36find_package(XKBCommon REQUIRED)
35find_package(WLC REQUIRED) 37find_package(WLC REQUIRED)
36find_package(A2X REQUIRED) 38find_package(A2X REQUIRED)
@@ -38,14 +40,12 @@ find_package(PCRE REQUIRED)
38find_package(JsonC REQUIRED) 40find_package(JsonC REQUIRED)
39 41
40FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) 42FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
41FILE(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
42 43
43include_directories( 44include_directories(
44 ${WLC_INCLUDE_DIRS} 45 ${WLC_INCLUDE_DIRS}
45 ${PCRE_INCLUDE_DIRS} 46 ${PCRE_INCLUDE_DIRS}
46 ${JSONC_INCLUDE_DIRS} 47 ${JSONC_INCLUDE_DIRS}
47 ${XKBCOMMON_INCLUDE_DIRS} 48 ${XKBCOMMON_INCLUDE_DIRS}
48 include/
49) 49)
50 50
51add_executable(sway 51add_executable(sway
@@ -58,6 +58,7 @@ target_link_libraries(sway
58 ${XKBCOMMON_LIBRARIES} 58 ${XKBCOMMON_LIBRARIES}
59 ${PCRE_LIBRARIES} 59 ${PCRE_LIBRARIES}
60 ${JSONC_LIBRARIES} 60 ${JSONC_LIBRARIES}
61 sway_common
61) 62)
62 63
63install( 64install(
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
new file mode 100644
index 00000000..f3a00626
--- /dev/null
+++ b/common/CMakeLists.txt
@@ -0,0 +1,3 @@
1add_library(sway_common STATIC
2 list.c
3 log.c)
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt
index e86cf656..1ad43324 100644
--- a/swaybg/CMakeLists.txt
+++ b/swaybg/CMakeLists.txt
@@ -8,7 +8,6 @@ include(Wayland)
8WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "xdg-shell.xml" xdg-shell) 8WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "xdg-shell.xml" xdg-shell)
9 9
10include_directories( 10include_directories(
11 ${CMAKE_CURRENT_SOURCE_DIR}/../include
12 ${WAYLAND_CLIENT_INCLUDE_DIR} 11 ${WAYLAND_CLIENT_INCLUDE_DIR}
13 ${CAIRO_INCLUDE_DIRS} 12 ${CAIRO_INCLUDE_DIRS}
14 ${PANGO_INCLUDE_DIRS} 13 ${PANGO_INCLUDE_DIRS}
@@ -16,7 +15,6 @@ include_directories(
16 15
17FILE(GLOB sources ${PROJECT_SOURCE_DIR}/*.c) 16FILE(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
18FILE(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c) 17FILE(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c)
19FILE(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
20 18
21add_executable(swaybg 19add_executable(swaybg
22 ${sources} 20 ${sources}
@@ -24,7 +22,7 @@ add_executable(swaybg
24 ${common} 22 ${common}
25) 23)
26 24
27TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES}) 25TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} sway_common)
28 26
29install( 27install(
30 TARGETS swaybg 28 TARGETS swaybg