X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CMakeLists.txt;h=a3ab4c37fc4702f0077a83fd32544b7dd5471b75;hb=0d170147150b90678225b55548215d09d8273e6d;hp=d78058841df884a23863359db46263e9744e4390;hpb=4db4634b28378379bce04f4073c2a511b92b1ee6;p=src%2Fapp-framework-binder.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d7805884..a3ab4c37 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,29 @@ 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(alsa alsa) +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(alsa_FOUND) + MESSAGE(STATUS "ALSA found ; will compile Audio plugin... (PLUGIN)") +ENDIF(alsa_FOUND) +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} ${uuid_INCLUDE_DIRS} ${alsa_INCLUDE_DIRS} ${librtlsdr_INCLUDE_DIRS}) +SET(link_libraries ${json-c_LIBRARIES} ${libmicrohttpd_LIBRARIES} ${uuid_LIBRARIES} ${alsa_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)