X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=99216600b5d24c02d4a33025cc798960174e6c76;hb=1867d049f8a3b181bb920fef6d904cfa67de06f0;hp=782e154c607ea417499001d19d450572b82df001;hpb=ecb483c282d48a6236c2aafd3beaa355e5a75e73;p=src%2Fapp-framework-main.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 782e154..9921660 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,12 +56,21 @@ 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(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 REQUIRED afb-daemon>=4.0) +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() ########################################################################### @@ -129,7 +138,7 @@ add_library(afm STATIC ) ########################################################################### -# packaging tools +# off line tools tools MESSAGE(STATUS "Creating packaging tools") @@ -148,36 +157,27 @@ 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_library(jbus STATIC utils-jbus.c) +if(libsystemd_FOUND AND AFB_FOUND) + MESSAGE(STATUS "Creating daemons") -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_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