Centralize dependencies, add D-Bus dep. to README.md
authorManuel Bachmann <manuel.bachmann@iot.bzh>
Tue, 22 Dec 2015 16:01:59 +0000 (17:01 +0100)
committerManuel Bachmann <manuel.bachmann@iot.bzh>
Tue, 22 Dec 2015 16:01:59 +0000 (17:01 +0100)
README.md now mentions D-Bus.
Checking dbus presence is now done at the same place as
json-c, libmicrohttpdd...

Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
CMakeLists.txt
README.md
plugins/CMakeLists.txt
plugins/afm-main-plugin/CMakeLists.txt

index 4fba65e..7e9502b 100644 (file)
@@ -37,6 +37,7 @@ INCLUDE(FindPkgConfig)
 PKG_CHECK_MODULES(json-c REQUIRED json-c)
 PKG_CHECK_MODULES(libmicrohttpd REQUIRED libmicrohttpd)
 PKG_CHECK_MODULES(uuid REQUIRED uuid)
+PKG_CHECK_MODULES(dbus REQUIRED dbus-1)
 # Optional plugin dependencies
 PKG_CHECK_MODULES(alsa alsa)
 PKG_CHECK_MODULES(librtlsdr librtlsdr>=0.5.0)
@@ -51,8 +52,8 @@ 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 -ldl)
+SET(include_dirs ${INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${json-c_INCLUDE_DIRS} ${libmicrohttpd_INCLUDE_DIRS} ${uuid_INCLUDE_DIRS} ${dbus_INCLUDE_DIRS} ${alsa_INCLUDE_DIRS} ${librtlsdr_INCLUDE_DIRS})
+SET(link_libraries ${json-c_LIBRARIES} ${libmicrohttpd_LIBRARIES} ${uuid_LIBRARIES} ${dbus_LIBRARIES} ${alsa_LIBRARIES} ${librtlsdr_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${libefence_LIBRARIES} -lmagic -lm -ldl)
 SET(plugin_install_dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/afb)
 
 ADD_DEFINITIONS(-DPLUGIN_INSTALL_DIR="${plugin_install_dir}")
index 5846f00..c54c0f1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ industry requirementsas the primary target for this code is AGL.
  * libmicrohttpd ("libmicrohttpd-dev/devel");
  * json-c ("libjson-c-dev/devel");
  * uuid ("uuid-dev/libuuid-devel");
+ * dbus ("libdbus-1-dev/dbus-1-devel");
 
  optionally, for plugins :
 
index 769cc1e..d856616 100644 (file)
@@ -1,5 +1,5 @@
+ADD_SUBDIRECTORY(afm-main-plugin)
 ADD_SUBDIRECTORY(session)
 ADD_SUBDIRECTORY(samples)
 ADD_SUBDIRECTORY(audio)
 ADD_SUBDIRECTORY(radio)
-ADD_SUBDIRECTORY(afm-main-plugin)
index 673bc95..5ed1d4b 100644 (file)
@@ -1,14 +1,7 @@
 
-
-pkg_check_modules(EXTRAS REQUIRED dbus-1)
-add_compile_options(${EXTRAS_CFLAGS})
-include_directories(${EXTRAS_INCLUDE_DIRS})
-link_libraries(${EXTRAS_LIBRARIES})
-
 ADD_LIBRARY(afm-main-api MODULE afm-main-plugin.c utils-jbus.c)
 SET_TARGET_PROPERTIES(afm-main-api PROPERTIES PREFIX "")
 TARGET_LINK_LIBRARIES(afm-main-api ${link_libraries})
 INCLUDE_DIRECTORIES(${include_dirs})
 INSTALL(TARGETS afm-main-api
           LIBRARY DESTINATION ${plugin_install_dir})
-