X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=99216600b5d24c02d4a33025cc798960174e6c76;hb=76e60e87a135522f091f444dab0a0e130906a554;hp=41c2b1eb8a275583332439e81c3f568d0c8f743c;hpb=fb0f81a1d8b5369842269fa1bdb9ad8d52882491;p=src%2Fapp-framework-main.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 41c2b1e..9921660 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 libsystemd>=222) +pkg_check_modules(EXTRAS REQUIRED libxml-2.0 openssl xmlsec1 xmlsec1-openssl json-c) add_compile_options(${EXTRAS_CFLAGS}) include_directories(${EXTRAS_INCLUDE_DIRS}) link_libraries(${EXTRAS_LIBRARIES}) @@ -56,6 +56,22 @@ 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(AFB afb-daemon>=4.99 libafbwsc>=4.99) +if(AFB_FOUND) + add_compile_options(${AFB_CFLAGS}) + include_directories(${AFB_INCLUDE_DIRS}) + link_libraries(${AFB_LIBRARIES}) +endif() + ########################################################################### if(SIMULATE_SECMGR) @@ -100,7 +116,6 @@ add_library(utils STATIC utils-dir.c utils-file.c utils-json.c - utils-jbus.c utils-systemd.c verbose.c ) @@ -118,14 +133,12 @@ add_library(secwrp STATIC ) add_library(afm STATIC - afm-db.c - afm-launch.c - afm-launch-mode.c - afm-run.c + afm-udb.c + afm-urun.c ) ########################################################################### -# packaging tools +# off line tools tools MESSAGE(STATUS "Creating packaging tools") @@ -144,37 +157,26 @@ 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 -MESSAGE(STATUS "Creating daemons") +# dynamic tool 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}) +if(libsystemd_FOUND AND AFB_FOUND) + MESSAGE(STATUS "Creating daemons") -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}) + add_library(jbus STATIC utils-jbus.c) -########################################################################### -# the binding for afb + 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}) -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 + 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-main-binding.export-map" + LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-binding.export-map" ) - install(TARGETS afm-main-binding LIBRARY DESTINATION ${afb_binding_install_dir}) + install(TARGETS afm-binding LIBRARY DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/afm) else() - message(STATUS "Not creating the binding for AFB-DAEMON") + MESSAGE(STATUS "Not creating daemons") endif() ###########################################################################