summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-03-15 11:49:29 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-03-17 13:01:40 +0100
commitfb0f81a1d8b5369842269fa1bdb9ad8d52882491 (patch)
treece78a61d1c9fdb46be72c6f0e0657e4a6c0abbdd /src/CMakeLists.txt
parent2a8b46d16ea5d0c99831e95b47cab037f220f7af (diff)
Emits reload to systemd when needed
The current implementation enforce the reload when a 'wants' target is created or deleted. This should work well for system units. However, for system units, this behaviour isn't enought when more that a user is active because only the user that installs the application will be updated. For this reason, a paralelle mechanism has to be defined. Also note that systemd is henceforth required for tools because wgtpkg-installer needs it now. Change-Id: I4fc03a44dbc58c2374ea21dbf6b436f646d04e00 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt96
1 files changed, 41 insertions, 55 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f121a62..41c2b1e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,7 +41,7 @@ set(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage")
include(FindPkgConfig)
-pkg_check_modules(EXTRAS REQUIRED libxml-2.0 openssl xmlsec1 xmlsec1-openssl json-c)
+pkg_check_modules(EXTRAS REQUIRED libxml-2.0 openssl xmlsec1 xmlsec1-openssl json-c libsystemd>=222)
add_compile_options(${EXTRAS_CFLAGS})
include_directories(${EXTRAS_INCLUDE_DIRS})
link_libraries(${EXTRAS_LIBRARIES})
@@ -100,6 +100,7 @@ add_library(utils STATIC
utils-dir.c
utils-file.c
utils-json.c
+ utils-jbus.c
utils-systemd.c
verbose.c
)
@@ -116,6 +117,13 @@ add_library(secwrp STATIC
secmgr-wrap.c
)
+add_library(afm STATIC
+ afm-db.c
+ afm-launch.c
+ afm-launch-mode.c
+ afm-run.c
+ )
+
###########################################################################
# packaging tools
@@ -136,60 +144,38 @@ target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils)
install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_BINDIR})
###########################################################################
-# the targeted
-
-pkg_check_modules(SYSTEMD libsystemd>=222)
-if(SYSTEMD_FOUND)
- add_compile_options(${SYSTEMD_CFLAGS})
- include_directories(${SYSTEMD_INCLUDE_DIRS})
- link_libraries(${SYSTEMD_LIBRARIES})
-
- add_library(utils2 STATIC
- utils-jbus.c
- )
-
- add_library(afm STATIC
- afm-db.c
- afm-launch.c
- afm-launch-mode.c
- afm-run.c
- )
-
- ###########################################################################
- # the daemons
- MESSAGE(STATUS "Creating daemons")
-
- add_executable(afm-user-daemon afm-user-daemon.c)
- target_link_libraries(afm-user-daemon afm secwrp wgt utils utils2)
- 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 utils2)
- install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
-
- ###########################################################################
- # the binding for afb
-
- pkg_check_modules(AFB afb-daemon)
- 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 utils2 ${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(SYSTEMD_FOUND)
+# the daemons
+MESSAGE(STATUS "Creating daemons")
+
+add_executable(afm-user-daemon afm-user-daemon.c)
+target_link_libraries(afm-user-daemon afm secwrp wgt utils)
+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)
+install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+###########################################################################
+# the binding for afb
+
+pkg_check_modules(AFB afb-daemon)
+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 ${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()
###########################################################################
# the tests