diff options
author | Simon Rettberg | 2019-05-10 15:25:43 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-05-10 15:25:43 +0200 |
commit | f7cd45464fd7c037f6a60098ae77760998b3b4b6 (patch) | |
tree | 02cf10b2766fc5bb47e44d7253d4ec4eb4a674d3 /CMakeLists.txt | |
download | idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.tar.gz idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.tar.xz idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.zip |
Initial commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..854e50a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) + +# cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug .. + +# project name +project(idle-daemon C) + +option(CMAKE_BUILD_TYPE Release) +set(CMAKE_C_FLAGS "-D_GNU_SOURCE") +set(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wextra -pedantic -Werror -Wno-multichar") +set(CMAKE_C_FLAGS_RELEASE "-O2 -Wno-multichar") + +file(GLOB_RECURSE IDLEDAEMON_SOURCES src/*.c) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} + ${X11_INCLUDE_DIR} +) + +FIND_PACKAGE(X11 REQUIRED) + +IF(NOT X11_Xscreensaver_FOUND) + MESSAGE(FATAL_ERROR "Could not find X11 extension Xscreensaver") +ENDIF() +IF(NOT X11_dpms_FOUND) + MESSAGE(FATAL_ERROR "Could not find X11 extension dpms") +ENDIF() + + +# +# build idle-daemon +# +add_executable(idle-daemon + ${IDLEDAEMON_SOURCES} +) + +target_link_libraries(idle-daemon + ${X11_LIBRARIES} + ${X11_Xscreensaver_LIB} +) + +install(TARGETS idle-daemon RUNTIME DESTINATION sbin) |