X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=CMakeLists.txt;h=af98b3898b42d09692713d182a3c2147d28a1b86;hb=662faf40f0c11536afcaa7e2ff0969f247ae4965;hp=d78058841df884a23863359db46263e9744e4390;hpb=4db4634b28378379bce04f4073c2a511b92b1ee6;p=src%2Fapp-framework-binder.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d7805884..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,8 +35,25 @@ 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) -SET(include_dirs ${INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${json-c_INCLUDE_DIRS} ${libmicrohttpd_INCLUDE_DIRS}) -SET(link_libraries ${json-c_LIBRARIES} ${libmicrohttpd_LIBRARIES} ${libefence_LIBRARIES} -lmagic) +IF(librtlsdr_FOUND) + MESSAGE(STATUS "librtlsdr found ; will compile Radio plugin... (PLUGIN)") +ENDIF(librtlsdr_FOUND) + +INCLUDE(FindThreads) +FIND_PACKAGE(Threads) + +SET(include_dirs ${INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${json-c_INCLUDE_DIRS} ${libmicrohttpd_INCLUDE_DIRS} ${librtlsdr_INCLUDE_DIRS}) +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_LINK_LIBRARIES(afb-daemon ${link_libraries}) + +INSTALL(TARGETS afb-daemon + RUNTIME DESTINATION bin)