summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-07 17:20:37 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:57 +0100
commitecb483c282d48a6236c2aafd3beaa355e5a75e73 (patch)
tree4362d82a05bb0403850677056674d5ca6b93f081 /src/CMakeLists.txt
parente8debaedb512bdc32932cf3e7a2446ac0e162508 (diff)
afm-binding: provide afm as a unique binding
This is the first stone (not fully tested) to implment the afm-main as a binding. At the end, this component will replace afm-user-daemon and afm-system-daemon. Change-Id: I6eafa7d26800f45ae58dd51aa9ff8008cdb3ff59 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt83
1 files changed, 37 insertions, 46 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cd3b9aa..782e154 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -56,14 +56,12 @@ else()
add_definitions(-DUSE_LIBZIP=0)
endif()
-pkg_check_modules(libsystemd libsystemd>=222)
-if(libsystemd_FOUND)
- add_compile_options(${libsystemd_CFLAGS})
- include_directories(${libsystemd_INCLUDE_DIRS})
- link_libraries(${libsystemd_LIBRARIES})
-else()
- add_definitions(-DNO_LIBSYSTEMD)
-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(AFB REQUIRED afb-daemon>=4.0)
###########################################################################
@@ -149,44 +147,37 @@ target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils)
install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_BINDIR})
-if(libsystemd_FOUND)
- ###########################################################################
- # the daemons
-
- MESSAGE(STATUS "Creating daemons")
-
- add_library(jbus STATIC utils-jbus.c)
-
- add_executable(afm-user-daemon afm-user-daemon.c)
- target_link_libraries(afm-user-daemon afm secwrp wgt utils jbus)
- install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
-
- 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})
-
- ###########################################################################
- # the binding for afb
-
- pkg_check_modules(AFB afb-daemon>=4.0)
- if(AFB_FOUND)
- message(STATUS "Creation afm-main-binding for AFB-DAEMON")
- ###############################################################
- pkg_get_variable(afb_binding_install_dir afb-daemon binding_install_dir)
- ###############################################################
- add_library(afm-main-binding MODULE afm-main-binding.c)
- target_compile_options(afm-main-binding PRIVATE ${AFB_CFLAGS})
- target_include_directories(afm-main-binding PRIVATE ${AFB_INCLUDE_DIRS})
- target_link_libraries(afm-main-binding utils jbus ${AFB_LIBRARIES})
- set_target_properties(afm-main-binding PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-main-binding.export-map"
- )
- install(TARGETS afm-main-binding LIBRARY DESTINATION ${afb_binding_install_dir})
- else()
- message(STATUS "Not creating the binding for AFB-DAEMON")
- endif()
-endif()
+###########################################################################
+# the daemons
+
+MESSAGE(STATUS "Creating daemons")
+
+add_library(jbus STATIC utils-jbus.c)
+
+add_executable(afm-user-daemon afm-user-daemon.c)
+target_link_libraries(afm-user-daemon afm secwrp wgt utils jbus)
+install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+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})
+
+###########################################################################
+# 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)
###########################################################################
# the tests