###########################################################################
-# Copyright 2015 IoT.bzh
+# Copyright 2015, 2016, 2017 IoT.bzh
#
# author: José Bollo <jose.bollo@iot.bzh>
#
include(FindPkgConfig)
-pkg_check_modules(EXTRAS REQUIRED libxml-2.0 openssl xmlsec1 xmlsec1-openssl)
+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})
pkg_check_modules(libzip libzip>=0.11)
-if(libzip_FOUND)
+if(libzip_FOUND AND USE_LIBZIP)
add_compile_options(${libzip_CFLAGS})
include_directories(${libzip_INCLUDE_DIRS})
link_libraries(${libzip_LIBRARIES})
###########################################################################
-if(USE_SIMULATION)
- include_directories(simulation)
-else(USE_SIMULATION)
+if(SIMULATE_SECMGR)
+ add_definitions(-DSIMULATE_SECURITY_MANAGER=1)
+else(SIMULATE_SECMGR)
pkg_check_modules(SECMGR REQUIRED security-manager)
add_compile_options(${SECMGR_CFLAGS})
include_directories(${SECMGR_INCLUDE_DIRS})
link_libraries(${SECMGR_LIBRARIES})
-endif(USE_SIMULATION)
+ add_definitions(-DSIMULATE_SECURITY_MANAGER=0)
+endif(SIMULATE_SECMGR)
+
+if(SIMULATE_SMACK)
+ add_definitions(-DSIMULATE_LIBSMACK=1)
+else(SIMULATE_SMACK)
+ pkg_check_modules(SMACK REQUIRED libsmack)
+ add_compile_options(${SMACK_CFLAGS})
+ include_directories(${SMACK_INCLUDE_DIRS})
+ link_libraries(${SMACK_LIBRARIES})
+ add_definitions(-DSIMULATE_LIBSMACK=0)
+endif(SIMULATE_SMACK)
###########################################################################
wgtpkg-digsig.c
wgtpkg-files.c
wgtpkg-install.c
+ wgtpkg-mustach.c
wgtpkg-permissions.c
wgtpkg-uninstall.c
+ wgtpkg-unit.c
wgtpkg-workdir.c
wgtpkg-xmlsec.c
wgtpkg-zip.c
)
add_library(utils STATIC
+ mustach.c
utils-dir.c
+ utils-file.c
+ utils-json.c
verbose.c
)
add_library(wgt STATIC
wgt-config.c
wgt-info.c
+ wgt-strings.c
+ wgt-json.c
wgt.c
)
###########################################################################
# the targeted
-pkg_check_modules(EXTRA2 json-c libsystemd)
+pkg_check_modules(EXTRA2 libsystemd)
if(EXTRA2_FOUND)
add_compile_options(${EXTRA2_CFLAGS})
include_directories(${EXTRA2_INCLUDE_DIRS})
add_library(utils2 STATIC
utils-jbus.c
- utils-json.c
)
add_library(afm STATIC
endif()
endif(EXTRA2_FOUND)
+
+###########################################################################
+# the tests
+
+add_subdirectory(tests)
+