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_Chrono.cmake 2.0KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # ---------------------------------
  2. # Finds third party boost chrono
  3. # Adds a def that its present
  4. # ---------------------------------
  5. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyBoost_Chrono)
  6. IF(WIN32)
  7. FIND_PATH(PATH_BOOST_CHRONO "include/boost/chrono.hpp" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES boost NO_DEFAULT_PATH)
  8. IF(PATH_BOOST_CHRONO)
  9. OV_PRINT(OV_PRINTED " Found boost chrono includes...")
  10. OV_LINK_BOOST_LIB("chrono" ${OV_WIN32_BOOST_VERSION} )
  11. IF(LIB_BOOST_PATH AND LIB_BOOST_DEBUG_PATH)
  12. ADD_DEFINITIONS(-DTARGET_HAS_Boost_Chrono)
  13. ENDIF(LIB_BOOST_PATH AND LIB_BOOST_DEBUG_PATH)
  14. ENDIF(PATH_BOOST_CHRONO)
  15. ENDIF(WIN32)
  16. IF(UNIX)
  17. FIND_PATH(PATH_BOOST_CHRONO "include/boost/chrono.hpp" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES boost NO_DEFAULT_PATH)
  18. FIND_PATH(PATH_BOOST_CHRONO "include/boost/chrono.hpp" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES boost)
  19. IF(PATH_BOOST_CHRONO)
  20. OV_PRINT(OV_PRINTED " Found boost chrono includes...")
  21. FIND_LIBRARY(LIB_Boost_Chrono NAMES "boost_chrono" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  22. FIND_LIBRARY(LIB_Boost_Chrono NAMES "boost_chrono" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib)
  23. IF(LIB_Boost_Chrono)
  24. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_Boost_Chrono}")
  25. ADD_DEFINITIONS(-DTARGET_HAS_Boost_Chrono)
  26. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Chrono})
  27. ELSE(LIB_Boost_Chrono)
  28. OV_PRINT(OV_PRINTED " [FAILED] lib boost_chrono")
  29. ENDIF(LIB_Boost_Chrono)
  30. # Fedora / Ubuntu
  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. ELSE(PATH_BOOST_CHRONO)
  39. OV_PRINT(OV_PRINTED " FAILED to find boost chrono includes...")
  40. ENDIF(PATH_BOOST_CHRONO)
  41. ENDIF(UNIX)
  42. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyBoost_Chrono "Yes")