aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore11
-rw-r--r--CMake/FindWLC.cmake20
-rw-r--r--CMake/FindXKBCommon.cmake19
-rw-r--r--CMakeLists.txt39
-rw-r--r--sway/main.c6
5 files changed, 95 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..b7b3266c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
1CMakeCache.txt
2CMakeFiles
3Makefile
4cmake_install.cmake
5install_manifest.txt
6*.swp
7*.o
8bin/
9test/
10build/
11.lvimrc
diff --git a/CMake/FindWLC.cmake b/CMake/FindWLC.cmake
new file mode 100644
index 00000000..15b26ce7
--- /dev/null
+++ b/CMake/FindWLC.cmake
@@ -0,0 +1,20 @@
1# - Find wlc
2# Find the wlc libraries
3#
4# This module defines the following variables:
5# WLC_FOUND - True if wlc is found
6# WLC_LIBRARIES - wlc libraries
7# WLC_INCLUDE_DIRS - wlc include directories
8# WLC_DEFINITIONS - Compiler switches required for using wlc
9#
10
11find_package(PkgConfig)
12pkg_check_modules(PC_WLC QUIET wlc)
13find_path(WLC_INCLUDE_DIRS NAMES wlc/wlc.h HINTS ${PC_WLC_INCLUDE_DIRS})
14find_library(WLC_LIBRARIES NAMES wlc HINTS ${PC_WLC_LIBRARY_DIRS})
15
16set(WLC_DEFINITIONS ${PC_WLC_CFLAGS_OTHER})
17
18include(FindPackageHandleStandardArgs)
19find_package_handle_standard_args(wlc DEFAULT_MSG WLC_LIBRARIES WLC_INCLUDE_DIRS)
20mark_as_advanced(WLC_LIBRARIES WLC_INCLUDE_DIRS)
diff --git a/CMake/FindXKBCommon.cmake b/CMake/FindXKBCommon.cmake
new file mode 100644
index 00000000..30ac503a
--- /dev/null
+++ b/CMake/FindXKBCommon.cmake
@@ -0,0 +1,19 @@
1# - Find XKBCommon
2# Once done, this will define
3#
4# XKBCOMMON_FOUND - System has XKBCommon
5# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
6# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
7# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
8
9find_package(PkgConfig)
10pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
11find_path(XKBCOMMON_INCLUDE_DIRS NAMES xkbcommon/xkbcommon.h HINTS ${PC_XKBCOMMON_INCLUDE_DIRS})
12find_library(XKBCOMMON_LIBRARIES NAMES xkbcommon HINTS ${PC_XKBCOMMON_LIBRARY_DIRS})
13
14set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
15
16include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
18mark_as_advanced(XKBCOMMON_LIBRARIES XKBCOMMON_INCLUDE_DIRS)
19
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..66879422
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,39 @@
1cmake_minimum_required(VERSION 2.8.5)
2project(sway C)
3set(CMAKE_C_FLAGS "-g")
4set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/")
5add_definitions("-Wall")
6set(CMAKE_BUILD_TYPE Debug)
7set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake)
8
9find_package(XKBCommon REQUIRED)
10
11if (UNIX)
12 find_library(DL_LIBRARY dl)
13 mark_as_advanced(DL_LIBRARY)
14 if (NOT DL_LIBRARY)
15 message(FATAL_ERROR "libdl is needed on unix systems")
16 endif ()
17endif (UNIX)
18
19FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c)
20
21include_directories(
22 ${WLC_INCLUDE_DIRS}
23 sway/
24)
25
26add_executable(sway
27 ${sources}
28)
29
30target_link_libraries(sway
31 ${WLC_LIBRARIES}
32 ${XKBCOMMON_LIBRARIES}
33 ${DL_LIBRARY}
34)
35
36INSTALL(
37 TARGETS sway
38 RUNTIME DESTINATION bin
39)
diff --git a/sway/main.c b/sway/main.c
new file mode 100644
index 00000000..e6a5b851
--- /dev/null
+++ b/sway/main.c
@@ -0,0 +1,6 @@
1#include <stdio.h>
2
3int main() {
4 printf("Hello world\n");
5 return 0;
6}