From 8a9ef3bc661d2784ab30759c0d865dea4253eb44 Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Sat, 27 Oct 2018 14:42:37 +0800 Subject: [PATCH] fix(CMakeLists.txt): do not require boost::signals, which will be deprecated in Boost 1.69 Fixes #225. We've been using signals2 library by default. --- CMakeLists.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b66850f31..134a3ad0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,20 @@ set(Boost_USE_MULTITHREADED ON) if(MSVC) set(Boost_USE_STATIC_RUNTIME ON) endif() -find_package(Boost 1.46.0 REQUIRED COMPONENTS filesystem regex signals system locale) + +if(NOT BOOST_USE_CXX11) + add_definitions("-DBOOST_NO_CXX11_SCOPED_ENUMS") +endif() + +set(BOOST_COMPONENTS filesystem regex system locale) + +if(BOOST_USE_SIGNALS2) + add_definitions("-DBOOST_SIGNALS2") +else() + set(BOOST_COMPONENTS ${BOOST_COMPONENTS} singals) +endif() + +find_package(Boost 1.46.0 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) @@ -136,14 +149,6 @@ if(UNIX) add_definitions("-std=c++11") endif() -if(NOT BOOST_USE_CXX11) - add_definitions("-DBOOST_NO_CXX11_SCOPED_ENUMS") -endif() - -if(BOOST_USE_SIGNALS2) - add_definitions("-DBOOST_SIGNALS2") -endif() - if(NOT DEFINED LIB_INSTALL_DIR) set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) endif()