aboutsummaryrefslogtreecommitdiff
path: root/sway/CMakeLists.txt
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-01 15:57:03 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-01 15:57:03 -0500
commitfc01f04c93c0de2a0cdcee946ac0131b86e18342 (patch)
tree204ba2fbc20298af8f159cd648c710b3a346135a /sway/CMakeLists.txt
parent297d8b3f02a97c8b23fedd4185016e785f7e2fda (diff)
parent38d4ee9f5030ad8bf383c8c24b0b13b20dbc45de (diff)
Merge pull request #287 from christophgysin/cmake
cmake: extract config from toplevel CMakeLists.txt
Diffstat (limited to 'sway/CMakeLists.txt')
-rw-r--r--sway/CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt
new file mode 100644
index 00000000..1e2f3fd3
--- /dev/null
+++ b/sway/CMakeLists.txt
@@ -0,0 +1,48 @@
+find_package(XKBCommon REQUIRED)
+find_package(WLC REQUIRED)
+find_package(PCRE REQUIRED)
+find_package(Wayland REQUIRED)
+find_package(JsonC REQUIRED)
+
+include(Wayland)
+WAYLAND_ADD_PROTOCOL_SERVER(proto-desktop-shell
+ ${PROJECT_SOURCE_DIR}/protocols/desktop-shell.xml
+ desktop-shell
+)
+
+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}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+add_executable(sway
+ ${sources}
+ ${common}
+ ${proto-desktop-shell}
+)
+
+target_link_libraries(sway
+ ${WLC_LIBRARIES}
+ ${XKBCOMMON_LIBRARIES}
+ ${PCRE_LIBRARIES}
+ ${JSONC_LIBRARIES}
+ ${WAYLAND_SERVER_LIBRARIES}
+)
+
+install(
+ TARGETS sway
+ RUNTIME
+ DESTINATION bin
+ COMPONENT runtime
+)
+install(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/config
+ DESTINATION ${FALLBACK_CONFIG_DIR}
+ COMPONENT configuration
+)