Tools: Fix regression bug to support Boost < 1.66

This commit is contained in:
Dennis Klein 2019-08-07 17:18:21 +02:00 committed by Dennis Klein
parent 291d00c73f
commit 03e6cea586
3 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,10 @@ if(BUILD_FAIRMQ)
find_package2(PUBLIC Boost VERSION 1.64 REQUIRED find_package2(PUBLIC Boost VERSION 1.64 REQUIRED
COMPONENTS container program_options thread system filesystem regex date_time signals COMPONENTS container program_options thread system filesystem regex date_time signals
) )
# Normalize Boost version
if(CMAKE_VERSION VERSION_LESS 3.15)
set(Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
find_package2(PUBLIC FairLogger VERSION 1.2.0 REQUIRED) find_package2(PUBLIC FairLogger VERSION 1.2.0 REQUIRED)
find_package2(PRIVATE ZeroMQ VERSION 4.1.5 REQUIRED) find_package2(PRIVATE ZeroMQ VERSION 4.1.5 REQUIRED)
endif() endif()

View File

@ -206,6 +206,9 @@ set_target_properties(${_target} PROPERTIES LABELS coverage)
if(FAST_BUILD) if(FAST_BUILD)
set_target_properties(${_target} PROPERTIES OUTPUT_NAME FairMQ) set_target_properties(${_target} PROPERTIES OUTPUT_NAME FairMQ)
endif() endif()
if(Boost_VERSION VERSION_LESS 1.66)
target_compile_definitions(${_target} PUBLIC FAIR_MQ_HAS_NO_ASIO_IO_CONTEXT)
endif()
####################### #######################
# include directories # # include directories #

View File

@ -18,8 +18,12 @@ namespace boost
namespace asio namespace asio
{ {
#ifdef FAIR_MQ_HAS_NO_ASIO_IO_CONTEXT
class io_service;
#else
class io_context; class io_context;
typedef class io_context io_service; typedef class io_context io_service;
#endif
} // namespace asio } // namespace asio
} // namespace boost } // namespace boost