aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2015-12-16 11:25:54 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2015-12-16 11:25:54 +0100
commite2d857c5f05f84de8e2642ff9272a80ea9e5fed6 (patch)
tree2df2f5939637de58a4fdad24b5cf0d5b9afd561f /CMakeLists.txt
parent4e43e3b53482bff8cb835271eb3207aeaf593812 (diff)
New tree organization, update CMake req. to 2.8.8.
Use CMake-2.8.8-specific feature to allow building the daemon from various source directories. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e9314d1..af98b389 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
PROJECT(afb-daemon C)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
SET(CMAKE_BUILD_TYPE, Debug)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -35,10 +35,9 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(json-c REQUIRED json-c)
PKG_CHECK_MODULES(libmicrohttpd REQUIRED libmicrohttpd)
+PKG_CHECK_MODULES(uuid REQUIRED uuid)
# Optional plugin dependencies
PKG_CHECK_MODULES(librtlsdr librtlsdr>=0.5.0)
-PKG_CHECK_MODULES(uuid REQUIRED uuid)
-
IF(librtlsdr_FOUND)
MESSAGE(STATUS "librtlsdr found ; will compile Radio plugin... (PLUGIN)")
@@ -51,3 +50,10 @@ SET(include_dirs ${INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${json-c_INCLUDE_DI
SET(link_libraries ${json-c_LIBRARIES} ${libmicrohttpd_LIBRARIES} ${uuid_LIBRARIES} ${librtlsdr_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${libefence_LIBRARIES} -lmagic -lm)
ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(plugins)
+
+ADD_EXECUTABLE(afb-daemon $<TARGET_OBJECTS:src> $<TARGET_OBJECTS:plugins>)
+TARGET_LINK_LIBRARIES(afb-daemon ${link_libraries})
+
+INSTALL(TARGETS afb-daemon
+ RUNTIME DESTINATION bin)