diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-10-12 10:58:40 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-11-24 17:44:57 +0100 |
commit | 1a67d1b401cbf132687b5aaea52ca7875edaa1f9 (patch) | |
tree | 083ad7c8f235bfe255ca00ad47ccccef19f62f05 /src/CMakeLists.txt | |
parent | dd87fc32c026b4fba9b13ab52f032e3b403b04bf (diff) |
Remove afm-system-daemon
Change-Id: I1e6c0488b7183724a65fcc06fd3cf6909e0efd53
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0214c12..e7b946b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,12 +56,12 @@ else() add_definitions(-DUSE_LIBZIP=0) endif() -pkg_check_modules(libsystemd REQUIRED libsystemd>=222) -add_compile_options(${libsystemd_CFLAGS}) -include_directories(${libsystemd_INCLUDE_DIRS}) -link_libraries(${libsystemd_LIBRARIES}) +pkg_check_modules(libsystemd libsystemd>=222) +if(NOT libsystemd_FOUND) + add_definitions(-DNO_LIBSYSTEMD) +endif() -pkg_check_modules(AFB REQUIRED afb-daemon>=4.99 libafbwsc>=4.99) +pkg_check_modules(AFB afb-daemon>=4.99 libafbwsc>=4.99) ########################################################################### @@ -129,7 +129,7 @@ add_library(afm STATIC ) ########################################################################### -# packaging tools +# off line tools tools MESSAGE(STATUS "Creating packaging tools") @@ -148,36 +148,31 @@ target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils) install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_BINDIR}) ########################################################################### -# the daemons +# dynamic tool daemons -MESSAGE(STATUS "Creating daemons") +if(libsystemd_FOUND AND AFB_FOUND) + MESSAGE(STATUS "Creating daemons") -add_library(jbus STATIC utils-jbus.c) + add_compile_options(${libsystemd_CFLAGS} ${AFB_CFLAGS}) + include_directories(${libsystemd_INCLUDE_DIRS} ${AFB_INCLUDE_DIRS}) + link_libraries(${libsystemd_LIBRARIES} ${AFB_LIBRARIES}) -add_executable(afm-user-daemon afm-user-daemon.c) -target_link_libraries(afm-user-daemon jbus utils afbwsc) -install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) + add_library(jbus STATIC utils-jbus.c) -add_executable(afm-system-daemon afm-system-daemon.c) -target_link_libraries(afm-system-daemon wgtpkg afm secwrp wgt utils jbus) -install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) + add_executable(afm-user-daemon afm-user-daemon.c) + target_link_libraries(afm-user-daemon jbus utils afbwsc) + install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) -########################################################################### -# the binding for afb - -message(STATUS "Creation afm-binding for AFB-DAEMON") -############################################################### -pkg_get_variable(afb_binding_install_dir afb-daemon binding_install_dir) -############################################################### -add_library(afm-binding MODULE afm-binding.c) -target_compile_options(afm-binding PRIVATE ${AFB_CFLAGS}) -target_include_directories(afm-binding PRIVATE ${AFB_INCLUDE_DIRS}) -target_link_libraries(afm-binding wgtpkg wgt secwrp utils afm ${AFB_LIBRARIES}) -set_target_properties(afm-binding PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-binding.export-map" -) -install(TARGETS afm-binding LIBRARY DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/afm) + add_library(afm-binding MODULE afm-binding.c) + target_link_libraries(afm-binding wgtpkg wgt secwrp utils afm) + set_target_properties(afm-binding PROPERTIES + PREFIX "" + LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-binding.export-map" + ) + install(TARGETS afm-binding LIBRARY DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/afm) +else() + MESSAGE(STATUS "Not creating daemons") +endif() ########################################################################### # the tests |