Added workaround to prevent building against new Asio headers

This commit is contained in:
Robert Osfield 2021-12-08 14:27:23 +00:00
parent d207c15705
commit f7aa4a8905

View File

@ -15,8 +15,20 @@ FIND_PATH(ASIO_INCLUDE_DIR
SET(ASIO_FOUND "NO") SET(ASIO_FOUND "NO")
IF(ASIO_INCLUDE_DIR) IF(ASIO_INCLUDE_DIR)
set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp)
file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ")
string(REGEX MATCHALL "[0-9]+" AsioHeaderVersionMatches "${AsioVersionLine}")
list(GET AsioHeaderVersionMatches 0 AsioHeaderVersion)
# check version is less than 1.14.0 otherwise API changes break build
if (${AsioHeaderVersion} LESS "101400")
FIND_PACKAGE( Boost 1.37 ) FIND_PACKAGE( Boost 1.37 )
IF(Boost_FOUND) IF(Boost_FOUND)
SET(ASIO_FOUND "YES") SET(ASIO_FOUND "YES")
ENDIF() ENDIF()
else()
message("ASIO not compatible")
endif()
ENDIF() ENDIF()