X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2FCMakeLists.txt;h=3a94d0db0289aa0e4865a891ca8e31f372baae0f;hb=0083ad3751cd2b088b5c5d0dea727671ea2a3cca;hp=e7b946b3c576feeefc3828ed68f52da0572a56fc;hpb=1a67d1b401cbf132687b5aaea52ca7875edaa1f9;p=src%2Fapp-framework-main.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7b946b..3a94d0d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ ########################################################################### -# Copyright 2015, 2016, 2017 IoT.bzh +# Copyright (C) 2015-2020 IoT.bzh # # author: José Bollo # @@ -45,23 +45,36 @@ pkg_check_modules(EXTRAS REQUIRED libxml-2.0 openssl xmlsec1 xmlsec1-openssl jso add_compile_options(${EXTRAS_CFLAGS}) include_directories(${EXTRAS_INCLUDE_DIRS}) link_libraries(${EXTRAS_LIBRARIES}) +link_directories(${EXTRAS_LIBRARY_DIRS}) pkg_check_modules(libzip libzip>=0.11) if(libzip_FOUND AND USE_LIBZIP) add_compile_options(${libzip_CFLAGS}) include_directories(${libzip_INCLUDE_DIRS}) link_libraries(${libzip_LIBRARIES}) + link_directories(${libzip_LIBRARY_DIRS}) add_definitions(-DUSE_LIBZIP=1) else() add_definitions(-DUSE_LIBZIP=0) endif() pkg_check_modules(libsystemd libsystemd>=222) -if(NOT libsystemd_FOUND) +if(libsystemd_FOUND) + add_compile_options(${libsystemd_CFLAGS}) + include_directories(${libsystemd_INCLUDE_DIRS}) + link_libraries(${libsystemd_LIBRARIES}) + link_directories(${libsystemd_LIBRARY_DIRS}) +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}) + link_directories(${AFB_LIBRARY_DIRS}) +endif() ########################################################################### @@ -72,6 +85,7 @@ else(SIMULATE_SECMGR) add_compile_options(${SECMGR_CFLAGS}) include_directories(${SECMGR_INCLUDE_DIRS}) link_libraries(${SECMGR_LIBRARIES}) + link_directories(${SECMGR_LIBRARY_DIRS}) add_definitions(-DSIMULATE_SECURITY_MANAGER=0) endif(SIMULATE_SECMGR) @@ -82,6 +96,7 @@ else(SIMULATE_SMACK) add_compile_options(${SMACK_CFLAGS}) include_directories(${SMACK_INCLUDE_DIRS}) link_libraries(${SMACK_LIBRARIES}) + link_directories(${SMACK_LIBRARY_DIRS}) add_definitions(-DSIMULATE_LIBSMACK=0) endif(SIMULATE_SMACK) @@ -133,19 +148,19 @@ add_library(afm STATIC MESSAGE(STATUS "Creating packaging tools") -add_executable(wgtpkg-sign wgtpkg-sign.c) +add_executable(wgtpkg-sign main-wgtpkg-sign.c) target_link_libraries(wgtpkg-sign wgtpkg utils) -add_executable(wgtpkg-pack wgtpkg-pack.c) +add_executable(wgtpkg-pack main-wgtpkg-pack.c) target_link_libraries(wgtpkg-pack wgtpkg utils) -add_executable(wgtpkg-info wgtpkg-info.c) +add_executable(wgtpkg-info main-wgtpkg-info.c) target_link_libraries(wgtpkg-info wgtpkg wgt utils) -add_executable(wgtpkg-installer wgtpkg-installer.c) -target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils) +add_executable(wgtpkg-install main-wgtpkg-install.c) +target_link_libraries(wgtpkg-install wgtpkg wgt secwrp utils) -install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-install DESTINATION ${CMAKE_INSTALL_BINDIR}) ########################################################################### # dynamic tool daemons @@ -153,15 +168,13 @@ install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION if(libsystemd_FOUND AND AFB_FOUND) MESSAGE(STATUS "Creating daemons") - add_compile_options(${libsystemd_CFLAGS} ${AFB_CFLAGS}) - include_directories(${libsystemd_INCLUDE_DIRS} ${AFB_INCLUDE_DIRS}) - link_libraries(${libsystemd_LIBRARIES} ${AFB_LIBRARIES}) - add_library(jbus STATIC utils-jbus.c) - 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}) + if(LEGACY_USER_DAEMON) + add_executable(afm-user-daemon afm-user-daemon.c) + target_link_libraries(afm-user-daemon jbus utils) + install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() add_library(afm-binding MODULE afm-binding.c) target_link_libraries(afm-binding wgtpkg wgt secwrp utils afm) @@ -169,7 +182,12 @@ if(libsystemd_FOUND AND AFB_FOUND) PREFIX "" LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/afm-binding.export-map" ) - install(TARGETS afm-binding LIBRARY DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/afm) + install(TARGETS afm-binding LIBRARY DESTINATION ${afm_libexecdir}) + + add_executable(afm-user-session afm-user-session.c) + install(TARGETS afm-user-session DESTINATION ${afm_libexecdir} + PERMISSIONS SETUID OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) else() MESSAGE(STATUS "Not creating daemons") endif()