peerplays-fc/CMakeModules/Boost/BoostConfig.cmake

19 lines
783 B
CMake
Raw Normal View History

2019-04-09 14:37:32 +00:00
# This overrides `find_package(Boost ... CONFIG ... )` calls
2019-05-20 12:59:30 +00:00
# - calls the CMake's built-in `FindBoost.cmake` and adds `pthread` library dependency
2019-04-09 14:37:32 +00:00
MESSAGE(STATUS "Using custom FindBoost config")
2019-05-20 12:59:30 +00:00
find_package(Boost 1.58 REQUIRED COMPONENTS ${Boost_FIND_COMPONENTS})
2019-04-09 14:37:32 +00:00
# Inject `pthread` dependency to Boost if needed
if (UNIX AND NOT CYGWIN)
list(FIND Boost_FIND_COMPONENTS thread _using_boost_thread)
if (_using_boost_thread GREATER -1)
find_library(BOOST_THREAD_LIBRARY NAMES pthread DOC "The threading library used by boost-thread")
if (BOOST_THREAD_LIBRARY)
MESSAGE(STATUS "Adding Boost thread lib dependency: ${BOOST_THREAD_LIBRARY}")
list(APPEND Boost_LIBRARIES ${BOOST_THREAD_LIBRARY})
endif ()
endif ()
2019-04-23 15:23:37 +00:00
endif ()