Commit 816ab9f3 authored by Dominik Charousset's avatar Dominik Charousset

Check for Boost before writing config w/ ASIO

parent 792162c4
......@@ -256,6 +256,7 @@ if(CAF_LOG_LEVEL)
else()
set(CAF_LOG_LEVEL_INT -1)
endif()
macro(to_int_value name)
if(${name})
set(${name}_INT 1)
......@@ -266,7 +267,21 @@ endmacro()
to_int_value(CAF_LOG_LEVEL)
to_int_value(CAF_NO_MEM_MANAGEMENT)
to_int_value(CAF_ENABLE_RUNTIME_CHECKS)
to_int_value(CAF_USE_ASIO)
# find boost asio if the asio multiplexer should be used for testing
if(CAF_USE_ASIO)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS system)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(LD_DIRS ${LD_DIRS} ${Boost_LIBRARIES})
set(LD_FLAGS ${LD_FLAGS} ${Boost_SYSTEM_LIBRARY})
set(CAF_USE_ASIO_INT 1)
else()
set(CAF_USE_ASIO no)
set(CAF_USE_ASIO_INT -1)
endif()
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/build_config.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/libcaf_core/caf/detail/build_config.hpp"
......@@ -452,14 +467,6 @@ endif()
################################################################################
if(NOT CAF_NO_UNIT_TESTS)
# find boost asio if the asio multiplexer should be used for testing
if(CAF_USE_ASIO)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS system REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
set(LD_DIRS ${LD_DIRS} ${Boost_LIBRARIES})
set(LD_FLAGS ${LD_FLAGS} ${Boost_SYSTEM_LIBRARY})
endif()
# setup unit test binary
add_executable(caf-test
libcaf_test/src/caf-test.cpp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment