diff --git a/CMakeLists.txt b/CMakeLists.txt index 669727f4d..c671bd520 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -924,20 +924,9 @@ if(STATIC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_FLAGS} ") endif() -set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(Boost_NO_BOOST_CMAKE ON) -if(STATIC) - if(MINGW) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) - endif() - - set(Boost_USE_STATIC_LIBS ON) - set(Boost_USE_STATIC_RUNTIME ON) -endif() - # Find Boost headers set(BOOST_MIN_VER 1.62) -find_package(Boost ${BOOST_MIN_VER} QUIET REQUIRED) +find_package(Boost ${BOOST_MIN_VER} QUIET REQUIRED CONFIG) if(NOT Boost_FOUND) message(FATAL_ERROR "Could not find Boost libraries, please make sure you have installed Boost or libboost-all-dev (>=${BOOST_MIN_VER}) or the equivalent") @@ -962,8 +951,7 @@ elseif(Boost_FOUND) message(STATUS "Boost components: ${BOOST_COMPONENTS}") # Find required Boost libraries - find_package(Boost ${BOOST_MIN_VER} QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES}) + find_package(Boost ${BOOST_MIN_VER} QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} CONFIG) endif() add_definitions(-DBOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION) diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk index 0160fea8d..af3b927fd 100644 --- a/contrib/depends/packages/boost.mk +++ b/contrib/depends/packages/boost.mk @@ -9,10 +9,11 @@ $(package)_config_opts_release=variant=release $(package)_config_opts_debug=variant=debug $(package)_config_opts+=--layout=system --user-config=user-config.jam $(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 -$(package)_config_opts_linux=threadapi=pthread runtime-link=shared -$(package)_config_opts_android=threadapi=pthread runtime-link=static target-os=android -$(package)_config_opts_darwin=runtime-link=shared target-os=darwin -$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static +$(package)_config_opts+=runtime-link=static +$(package)_config_opts_linux=threadapi=pthread +$(package)_config_opts_android=threadapi=pthread target-os=android +$(package)_config_opts_darwin=target-os=darwin +$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 $(package)_config_opts_x86_64_mingw32=address-model=64 $(package)_config_opts_i686_mingw32=address-model=32 $(package)_config_opts_i686_linux=address-model=32 architecture=x86