$OpenBSD: patch-Modules_FindBoost_cmake,v 1.13 2017/01/16 08:51:50 dcoppa Exp $
--- Modules/FindBoost.cmake.orig	Fri Jan 13 15:05:41 2017
+++ Modules/FindBoost.cmake	Mon Jan 16 09:12:56 2017
@@ -884,6 +884,22 @@ function(_Boost_MISSING_DEPENDENCIES componentvar extr
   set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
 endfunction()
 
+function(_Boost_consider_adding_pthread _outvar)
+  # On Unix platforms (excluding Cygwin) add pthread to Boost_LIBRARIES
+  # if the user is searching for the boost-thread component.
+  if(UNIX AND NOT CYGWIN)
+    list(FIND Boost_FIND_COMPONENTS thread _using_boost_thread)
+    if(_using_boost_thread GREATER -1)
+      set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+      set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+      find_package(Threads)
+      if(Threads_FOUND)
+        set(${_outvar} ${ARGN} Threads::Threads PARENT_SCOPE)
+      endif()
+    endif()
+  endif()
+endfunction()
+
 #
 # Update library search directory hint variable with paths used by prebuilt boost binaries.
 #
@@ -1807,6 +1823,8 @@ if(Boost_FOUND)
       list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
     endif()
   endforeach()
+  # Add pthread library if thread component was found
+  _Boost_consider_adding_pthread(Boost_LIBRARIES ${Boost_LIBRARIES})
 else()
   if(Boost_FIND_REQUIRED)
     message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
