You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindThirdPartyBoost_Thread.cmake 2.0KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # ---------------------------------
  2. # Finds third party boost
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyBoost_Thread)
  7. IF(UNIX)
  8. FIND_LIBRARY(LIB_Boost_Thread NAMES "boost_thread-mt" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  9. FIND_LIBRARY(LIB_Boost_Thread NAMES "boost_thread-mt" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib)
  10. IF(LIB_Boost_Thread)
  11. OV_PRINT(OV_PRINTED " Found boost thread...")
  12. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_Boost_Thread}")
  13. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Thread} )
  14. ELSE(LIB_Boost_Thread)
  15. # Fedora 20 and Ubuntu 13.10,14.04 have no more multi-thread boost libs ( *-mt ) so try if there are non -mt libs to link
  16. FIND_LIBRARY(LIB_Boost_Thread NAMES "boost_thread" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  17. FIND_LIBRARY(LIB_Boost_Thread NAMES "boost_thread" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib)
  18. IF(LIB_Boost_Thread)
  19. OV_PRINT(OV_PRINTED " Found boost thread...")
  20. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_Boost_Thread}")
  21. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Thread})
  22. ELSE(LIB_Boost_Thread)
  23. OV_PRINT(OV_PRINTED " FAILED to find boost thread...")
  24. OV_PRINT(OV_PRINTED " [FAILED] lib boost_thread-mt")
  25. OV_PRINT(OV_PRINTED " [FAILED] lib boost_thread")
  26. ENDIF(LIB_Boost_Thread)
  27. ENDIF(LIB_Boost_Thread)
  28. # For Fedora
  29. INCLUDE("FindThirdPartyPThread")
  30. # For Ubuntu 13.04 (interprocess/ipc/message_queue.hpp in ovasCPluginExternalStimulations.cpp caused dep)
  31. FIND_LIBRARY(LIB_STANDARD_MODULE_RT rt)
  32. IF(LIB_STANDARD_MODULE_RT)
  33. OV_PRINT(OV_PRINTED " Found rt...")
  34. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_STANDARD_MODULE_RT})
  35. ELSE(LIB_STANDARD_MODULE_RT)
  36. OV_PRINT(OV_PRINTED " FAILED to find rt...")
  37. ENDIF(LIB_STANDARD_MODULE_RT)
  38. ENDIF(UNIX)
  39. IF(WIN32)
  40. OV_LINK_BOOST_LIB("thread" ${OV_WIN32_BOOST_VERSION})
  41. ENDIF(WIN32)
  42. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyBoost_Thread "Yes")