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_FileSystem.cmake 1.8KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_FileSystem)
  7. IF(UNIX)
  8. FIND_LIBRARY(LIB_Boost_Filesystem NAMES "boost_filesystem-mt" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  9. FIND_LIBRARY(LIB_Boost_Filesystem NAMES "boost_filesystem-mt" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib)
  10. IF(LIB_Boost_Filesystem)
  11. OV_PRINT(OV_PRINTED " Found boost FileSystem...")
  12. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_Boost_Filesystem}")
  13. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Filesystem} )
  14. ELSE(LIB_Boost_Filesystem)
  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_Filesystem NAMES "boost_filesystem" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib NO_DEFAULT_PATH)
  17. FIND_LIBRARY(LIB_Boost_Filesystem NAMES "boost_filesystem" PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES lib)
  18. IF(LIB_Boost_Filesystem)
  19. OV_PRINT(OV_PRINTED " Found boost FileSystem...")
  20. OV_PRINT(OV_PRINTED " [ OK ] lib ${LIB_Boost_Filesystem}")
  21. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_Boost_Filesystem})
  22. ELSE(LIB_Boost_Filesystem)
  23. OV_PRINT(OV_PRINTED " FAILED to find boost FileSystem...")
  24. OV_PRINT(OV_PRINTED " [FAILED] lib boost_filesystem-mt")
  25. OV_PRINT(OV_PRINTED " [FAILED] lib boost_filesystem")
  26. ENDIF(LIB_Boost_Filesystem)
  27. ENDIF(LIB_Boost_Filesystem)
  28. # For Fedora
  29. INCLUDE("FindThirdPartyPThread")
  30. ENDIF(UNIX)
  31. IF(WIN32)
  32. OV_LINK_BOOST_LIB("filesystem" ${OV_WIN32_BOOST_VERSION} )
  33. OV_LINK_BOOST_LIB("system" ${OV_WIN32_BOOST_VERSION} ) # filesystem depends on system
  34. ENDIF(WIN32)
  35. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyBoost_FileSystem "Yes")