WtFindBoost-cmake.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # This file sets:
  2. # - BOOST_INCLUDE_DIRS
  3. # - BOOST_LIB_DIRS
  4. # - BOOST_WT_FOUND // All dependencies for wt found
  5. # - BOOST_WT_MT_FOUND
  6. # - BOOST_WTHTTP_FOUND // All dependencies for wthttp found
  7. # - BOOST_WTHTTP_MT_FOUND
  8. # - BOOST_SUPPORT_LIBRARIES (should always be added to the boost libs)
  9. # - BOOST_WT_LIBRARIES
  10. #
  11. # Separate compiled boost libraries are also discovered:
  12. # - BOOST_DT_LIB
  13. # - BOOST_FS_LIB
  14. # - BOOST_REGEX_LIB
  15. # - BOOST_PO_LIB
  16. # - BOOST_SIGNALS_LIB
  17. # - BOOST_SYSTEM_LIB
  18. # - BOOST_THREAD_LIB (only if BOOST_MT_FOUND)
  19. # Boost will try to find the same kind (mt or not) of library for all three
  20. # of these libraries. Boost is considered to be found successfully only
  21. # when the libraries are all of the same kind (mt or not). If the mt
  22. # libraries exits, the mt versions will be used unless MULTI_THREADED is
  23. # set to OFF. Otherwise, the non-mt versions will be used.
  24. #
  25. # For starters, see if the cmake-provided scripts are able to find boost
  26. SET(BOOST_WT_FOUND FALSE)
  27. SET(BOOST_WT_MT_FOUND FALSE)
  28. SET(BOOST_WTHTTP_FOUND FALSE)
  29. SET(BOOST_WTHTTP_MT_FOUND FALSE)
  30. SET(BOOST_SUPPORT_LIBRARIES "")
  31. IF(NOT DEFINED Boost_ADDITIONAL_VERSIONS)
  32. SET(Boost_ADDITIONAL_VERSIONS
  33. "1.35" "1.36" "1.37" "1.38" "1.39"
  34. "1.40" "1.41" "1.42" "1.43" "1.44" "1.45" "1.46" "1.47" "1.48" "1.49"
  35. "1.50" "1.51" "1.52" "1.53" "1.54" "1.55" "1.56" "1.57" "1.58" "1.59"
  36. "1.60" "1.61" "1.62" "1.63" "1.64" "1.65" "1.66" "1.67" "1.68" "1.69"
  37. "1.70" "1.71" "1.72" "1.73" "1.74" "1.75" "1.76" "1.77" "1.78" "1.79")
  38. ENDIF(NOT DEFINED Boost_ADDITIONAL_VERSIONS)
  39. SET(Boost_USE_MULTITHREADED ON)
  40. IF(DEFINED BOOST_PREFIX AND NOT DEFINED BOOST_ROOT)
  41. SET(BOOST_ROOT ${BOOST_PREFIX})
  42. ENDIF(DEFINED BOOST_PREFIX AND NOT DEFINED BOOST_ROOT)
  43. IF(WIN32)
  44. IF(BOOST_DYNAMIC)
  45. SET(Boost_USE_STATIC_LIBS OFF)
  46. ELSE(BOOST_DYNAMIC)
  47. SET(Boost_USE_STATIC_LIBS ON)
  48. ENDIF(BOOST_DYNAMIC)
  49. ENDIF(WIN32)
  50. SET(Boost_DEBUG ON)
  51. OPTION(WT_NO_BOOST_RANDOM "For compatibility with older boost versions. Do not enable for boost > 1.45" OFF)
  52. MESSAGE("WT_NO_BOOST_RANDOM is ${WT_NO_BOOST_RANDOM}")
  53. SET(Boost_COMPONENTS
  54. date_time
  55. regex
  56. program_options
  57. signals
  58. system
  59. filesystem
  60. thread
  61. )
  62. IF(NOT WT_NO_BOOST_RANDOM)
  63. SET(Boost_COMPONENTS
  64. ${Boost_COMPONENTS}
  65. random
  66. )
  67. ENDIF(NOT WT_NO_BOOST_RANDOM)
  68. FIND_PACKAGE(Boost 1.35
  69. COMPONENTS
  70. ${Boost_COMPONENTS}
  71. REQUIRED
  72. )
  73. IF (Boost_FOUND)
  74. # Translate variables from official cmake names to internally used names
  75. SET(BOOST_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
  76. SET(BOOST_LIB_DIRS ${Boost_LIBRARY_DIRS})
  77. SET(BOOST_DT_LIB ${Boost_DATE_TIME_LIBRARY})
  78. SET(BOOST_FS_LIB ${Boost_FILESYSTEM_LIBRARY})
  79. SET(BOOST_REGEX_LIB ${Boost_REGEX_LIBRARY})
  80. SET(BOOST_PO_LIB ${Boost_PROGRAM_OPTIONS_LIBRARY})
  81. SET(BOOST_SIGNALS_LIB ${Boost_SIGNALS_LIBRARY})
  82. SET(BOOST_SYSTEM_LIB ${Boost_SYSTEM_LIBRARY})
  83. SET(BOOST_THREAD_LIB ${Boost_THREAD_LIBRARY})
  84. IF(NOT WT_NO_BOOST_RANDOM)
  85. SET(BOOST_RANDOM_LIB ${Boost_RANDOM_LIBRARY})
  86. ENDIF(NOT WT_NO_BOOST_RANDOM)
  87. SET(BOOST_WT_MT_FOUND TRUE)
  88. SET(BOOST_WT_FOUND TRUE)
  89. SET(BOOST_WTHTTP_MT_FOUND TRUE)
  90. SET(BOOST_WTHTTP_FOUND TRUE)
  91. IF(MSVC)
  92. # use autolink
  93. SET(BOOST_WT_LIBRARIES "")
  94. SET(BOOST_WTHTTP_LIBRARIES "")
  95. ELSE(MSVC)
  96. SET(BOOST_WT_LIBRARIES
  97. ${Boost_THREAD_LIBRARY}
  98. ${BOOST_RANDOM_LIB}
  99. ${Boost_REGEX_LIBRARY}
  100. ${Boost_SIGNALS_LIBRARY}
  101. ${Boost_SYSTEM_LIBRARY}
  102. ${Boost_FILESYSTEM_LIBRARY}
  103. ${Boost_DATE_TIME_LIBRARY})
  104. SET(BOOST_WTHTTP_LIBRARIES
  105. ${Boost_THREAD_LIBRARY}
  106. ${Boost_PROGRAM_OPTIONS_LIBRARY}
  107. ${Boost_SYSTEM_LIBRARY}
  108. ${Boost_FILESYSTEM_LIBRARY}
  109. ${Boost_DATE_TIME_LIBRARY})
  110. ENDIF(MSVC)
  111. ENDIF (Boost_FOUND)