diff options
author | eidheim <eidheim@gmail.com> | 2016-10-25 09:45:36 +0300 |
---|---|---|
committer | eidheim <eidheim@gmail.com> | 2016-10-25 09:45:36 +0300 |
commit | 27f9b29361ad83d67ad25382f21f3db8f8c72cf4 (patch) | |
tree | 0f3b9d4b397901a24b8b7ef29977378e419de96e /CMakeLists.txt | |
parent | 352f13b509c624acb372114d509b740bc3d55b78 (diff) |
Added fallback to boost::regex if gcc version<4.9
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 41b70a6..b310e5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,16 @@ cmake_minimum_required (VERSION 2.8) project (Simple-WebSocket-Server) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra") -#Only tested with versions 1.55 and 1.56 -find_package(Boost 1.54.0 COMPONENTS system coroutine context thread REQUIRED) -include_directories(${Boost_INCLUDE_DIR}) +set(BOOST_COMPONENTS system coroutine context thread) +# Late 2017 TODO: remove the following checks and always use std::regex +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) + set(BOOST_COMPONENTS ${BOOST_COMPONENTS} regex) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST_REGEX") + endif() +endif() +find_package(Boost 1.54.0 COMPONENTS ${BOOST_COMPONENTS} REQUIRED) +include_directories(SYSTEM ${Boost_INCLUDE_DIR}) if(APPLE) set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") |