X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=bbcf04b1165fd7574c054d84a92d62059bd30612;hb=941eb7ef734e7d6a9de9c7af13345e63f708d169;hp=f121a6265aba4fac941b2953d442dc807aaa4b26;hpb=2a8b46d16ea5d0c99831e95b47cab037f220f7af;p=src%2Fapp-framework-main.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f121a62..bbcf04b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,6 +56,15 @@ 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() + ########################################################################### if(SIMULATE_SECMGR) @@ -116,6 +125,15 @@ add_library(secwrp STATIC secmgr-wrap.c ) +add_library(afm STATIC + afm-db.c + afm-udb.c + afm-launch.c + afm-launch-mode.c + afm-run.c + afm-urun.c + ) + ########################################################################### # packaging tools @@ -135,36 +153,20 @@ 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 - ) - +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 utils2) + 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 utils2) + target_link_libraries(afm-system-daemon wgtpkg afm secwrp wgt utils jbus) install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) ########################################################################### @@ -179,7 +181,7 @@ if(SYSTEMD_FOUND) 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}) + 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" @@ -188,8 +190,7 @@ if(SYSTEMD_FOUND) else() message(STATUS "Not creating the binding for AFB-DAEMON") endif() - -endif(SYSTEMD_FOUND) +endif() ########################################################################### # the tests