aboutsummaryrefslogtreecommitdiff
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")
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/CMake")
-add_subdirectory(swaybg swaybg)
-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
execute_process(
COMMAND git describe --always
@@ -31,6 +29,10 @@ add_definitions("-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\"")
string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
add_definitions("-DSWAY_VERSION_DATE=${CURRENT_DATE}")
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
+add_subdirectory(common)
+add_subdirectory(swaybg)
+
find_package(XKBCommon REQUIRED)
find_package(WLC REQUIRED)
find_package(A2X REQUIRED)
@@ -38,14 +40,12 @@ find_package(PCRE REQUIRED)
find_package(JsonC REQUIRED)
FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
-FILE(GLOB common ${PROJECT_SOURCE_DIR}/common/*.c)
include_directories(
${WLC_INCLUDE_DIRS}
${PCRE_INCLUDE_DIRS}
${JSONC_INCLUDE_DIRS}
${XKBCOMMON_INCLUDE_DIRS}
- include/
)
add_executable(sway
@@ -58,6 +58,7 @@ target_link_libraries(sway
${XKBCOMMON_LIBRARIES}
${PCRE_LIBRARIES}
${JSONC_LIBRARIES}
+ sway_common
)
install(
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 @@
+add_library(sway_common STATIC
+ list.c
+ 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)
WAYLAND_ADD_PROTOCOL_CLIENT(proto-xdg-shell "xdg-shell.xml" xdg-shell)
include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/../include
${WAYLAND_CLIENT_INCLUDE_DIR}
${CAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS}
@@ -16,7 +15,6 @@ include_directories(
FILE(GLOB sources ${PROJECT_SOURCE_DIR}/*.c)
FILE(GLOB wl_sources ${PROJECT_SOURCE_DIR}/../wayland/*.c)
-FILE(GLOB common ${PROJECT_SOURCE_DIR}/../common/*.c)
add_executable(swaybg
${sources}
@@ -24,7 +22,7 @@ add_executable(swaybg
${common}
)
-TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES})
+TARGET_LINK_LIBRARIES(swaybg ${WAYLAND_CLIENT_LIBRARIES} ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} sway_common)
install(
TARGETS swaybg