fix compilation of tests under yocto

This commit is contained in:
amsobr 2020-11-03 14:23:48 +00:00
parent 0be822dcf4
commit 93e602f07d

View File

@ -1,10 +1,23 @@
cmake_minimum_required(VERSION 3.7.0)
project(daemon-test CXX)
set(CMAKE_CXX_STANDARD 17)
set(CPP_HTTPLIB " ../3rdparty/cpp-httplib/")
set(CMAKE_CXX_FLAGS "-g -O3 -DBOOST_LOG_DYN_LINK -DBOOST_LOG_USE_NATIVE_SYSLOG -Wall")
# use sysroot cpp-http lib unless one was explicitly provided in cmdline
if ( NOT CPP_HTTPLIB_DIR )
find_path( CPP_HTTPLIB_DIR "httplib.h" REQUIRED)
endif()
# ravena lkm _should_ be provided by the CLI. Nonetheless, we should be able
# to find it in system dirs too...
if ( NOT RAVENNNA_ALSA_LKM_DIR )
find_path(RAVENNA_ALSA_LKM_DIR "common/MergingRAVENNACommon.h" REQUIRED)
endif()
add_definitions( -DBOOST_LOG_DYN_LINK -DBOOST_LOG_USE_NATIVE_SYSLOG )
add_compile_options( -Wall )
find_package(Boost COMPONENTS unit_test_framework filesystem system thread REQUIRED)
include_directories(aes67-daemon ${CPP_HTTPLIB} ${Boost_INCLUDE_DIR})
include_directories(aes67-daemon ${CPP_HTTPLIB_DIR} ${RAVENNA_ALSA_LKM_DIR}/common ${RAVENNA_ALSA_LKM_DIR}/driver ${Boost_INCLUDE_DIR})
add_executable(daemon-test daemon_test.cpp)
target_link_libraries(daemon-test ${Boost_LIBRARIES})
add_test(daemon-test daemon-test)