FindBoost.cmake 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. # - Try to find Boost include dirs and libraries
  2. # Usage of this module as follows:
  3. #
  4. # SET(Boost_USE_STATIC_LIBS ON)
  5. # SET(Boost_USE_MULTITHREAD OFF)
  6. # FIND_PACKAGE( Boost 1.34.1 COMPONENTS date_time filesystem iostreams ... )
  7. #
  8. # INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
  9. # ADD_EXECUTABLE(foo foo.cc)
  10. # TARGET_LINK_LIBRARIES(foo ${Boost_LIBRARIES})
  11. #
  12. # The Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
  13. # boost version numbers that should be taken into account when searching
  14. # for the libraries. Unfortunately boost puts the version number into the
  15. # actual filename for the libraries, so this might be needed in the future
  16. # when new Boost versions are released. CMake will one day have glob
  17. # or regex support for FIND_LIBRARY() after which this variable will
  18. # likely be removed.
  19. #
  20. # Currently this module searches for the following version numbers:
  21. # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, 1.36,
  22. # 1.36.0, 1.36.1, 1.37
  23. #
  24. # The components list needs to be the actual names of boost libraries, that is
  25. # the part of the actual library files that differ on different libraries. So
  26. # its "date_time" for "libboost_date_time...". Anything else will result in
  27. # errors
  28. #
  29. # You can provide a minimum version number that should be used. If you provide this
  30. # version number and specify the REQUIRED attribute, this module will fail if it
  31. # can't find the specified or a later version. If you specify a version number this is
  32. # automatically put into the considered list of version numbers and thus doesn't need
  33. # to be specified in the Boost_ADDITIONAL_VERSIONS variable
  34. #
  35. # Variables used by this module, they can change the default behaviour and need to be set
  36. # before calling find_package:
  37. #
  38. # Boost_USE_MULTITHREAD Can be set to OFF to use the non-multithreaded
  39. # boost libraries. Defaults to ON.
  40. #
  41. # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
  42. # boost libraries. Defaults to OFF.
  43. #
  44. # Other Variables used by this module which you may want to set.
  45. #
  46. # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
  47. # the boost include directory. The default list
  48. # of version numbers is:
  49. # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1,
  50. # 1.35, 1.35.0, 1.35.1, 1.36, 1.36.0, 1.36.1,
  51. # 1.37
  52. # If you want to look for an older or newer
  53. # version set this variable to a list of
  54. # strings, where each string contains a number, i.e.
  55. # SET(Boost_ADDITIONAL_VERSIONS "0.99.0" "1.35.0")
  56. #
  57. # Boost_DEBUG Set this to TRUE to enable debugging output
  58. # of FindBoost.cmake if you are having problems.
  59. # Please enable this and include the output in any bug reports.
  60. #
  61. # Boost_COMPILER Set this to the compiler suffix used by boost (e.g. -gcc43) if the
  62. # module has problems finding the proper Boost installation
  63. #
  64. # BOOST_ROOT or BOOSTROOT Preferred installation prefix for searching for Boost,
  65. # set this if the module has problems finding the proper Boost installation
  66. #
  67. # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
  68. # module has problems finding the proper Boost installation
  69. #
  70. # BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the
  71. # module has problems finding the proper Boost installation
  72. #
  73. # The last three variables are available also as environment variables
  74. #
  75. #
  76. # Variables defined by this module:
  77. #
  78. # Boost_FOUND System has Boost, this means the include dir was found,
  79. # as well as all the libraries specified in the COMPONENTS list
  80. #
  81. # Boost_INCLUDE_DIRS Boost include directories, not cached
  82. #
  83. # Boost_INCLUDE_DIR This is almost the same as above, but this one is cached and may be
  84. # modified by advanced users
  85. #
  86. # Boost_LIBRARIES Link these to use the Boost libraries that you specified, not cached
  87. #
  88. # Boost_LIBRARY_DIRS The path to where the Boost library files are.
  89. #
  90. # Boost_VERSION The version number of the boost libraries that have been found,
  91. # same as in version.hpp from Boost
  92. #
  93. # Boost_LIB_VERSION The version number in filename form as its appended to the library filenames
  94. #
  95. # Boost_MAJOR_VERSION major version number of boost
  96. #
  97. # Boost_MINOR_VERSION minor version number of boost
  98. #
  99. # Boost_SUBMINOR_VERSION subminor version number of boost
  100. #
  101. # Boost_LIB_DIAGNOSTIC_DEFINITIONS Only set on windows. Can be used with add_definitions
  102. # to print diagnostic information about the automatic
  103. # linking done on windows.
  104. # For each component you list the following variables are set.
  105. # ATTENTION: The component names need to be in lower case, just as the boost
  106. # library names however the cmake variables use upper case for the component
  107. # part. So you'd get Boost_SERIALIZATION_FOUND for example.
  108. #
  109. # Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found.
  110. # Boost_${COMPONENT}_LIBRARY The absolute path of the Boost library "component".
  111. # Boost_${COMPONENT}_LIBRARY_DEBUG The absolute path of the debug version of the
  112. # Boost library "component".
  113. # Boost_${COMPONENT}_LIBRARY_RELEASE The absolute path of the release version of the
  114. # Boost library "component"
  115. #
  116. # Copyright (c) 2006-2008 Andreas Schneider <[email protected]>
  117. # Copyright (c) 2007 Wengo
  118. # Copyright (c) 2007 Mike Jackson
  119. # Copyright (c) 2008 Andreas Pakulat <[email protected]>
  120. #
  121. # Redistribution AND use is allowed according to the terms of the New
  122. # BSD license.
  123. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  124. #
  125. OPTION(Boost_USE_MULTITHREADED
  126. "Use the multithreaded versions of the Boost libraries" ON)
  127. if(Boost_FIND_VERSION_EXACT)
  128. # The version may appear in a directory with or without the patch
  129. # level, even when the patch level is non-zero.
  130. set(_boost_TEST_VERSIONS
  131. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
  132. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  133. else(Boost_FIND_VERSION_EXACT)
  134. # The user has not requested an exact version. Among known
  135. # versions, find those that are acceptable to the user request.
  136. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
  137. "1.37" "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
  138. "1.34" "1.33.1" "1.33.0" "1.33")
  139. set(_boost_TEST_VERSIONS)
  140. if(Boost_FIND_VERSION)
  141. set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  142. # Select acceptable versions.
  143. foreach(version ${_Boost_KNOWN_VERSIONS})
  144. if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
  145. # This version is high enough.
  146. list(APPEND _boost_TEST_VERSIONS "${version}")
  147. elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
  148. # This version is a short-form for the requested version with
  149. # the patch level dropped.
  150. list(APPEND _boost_TEST_VERSIONS "${version}")
  151. endif()
  152. endforeach(version)
  153. else(Boost_FIND_VERSION)
  154. # Any version is acceptable.
  155. set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
  156. endif(Boost_FIND_VERSION)
  157. endif(Boost_FIND_VERSION_EXACT)
  158. # The reason that we failed to find Boost. This will be set to a
  159. # user-friendly message when we fail to find some necessary piece of
  160. # Boost.
  161. set(Boost_ERROR_REASON)
  162. ############################################
  163. #
  164. # Check the existence of the libraries.
  165. #
  166. ############################################
  167. # This macro was taken directly from the FindQt4.cmake file that is included
  168. # with the CMake distribution. This is NOT my work. All work was done by the
  169. # original authors of the FindQt4.cmake file. Only minor modifications were
  170. # made to remove references to Qt and make this file more generally applicable
  171. #########################################################################
  172. MACRO (_Boost_ADJUST_LIB_VARS basename)
  173. IF (Boost_INCLUDE_DIR )
  174. IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
  175. # if the generator supports configuration types then set
  176. # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
  177. IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
  178. SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  179. ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
  180. # if there are no configuration types and CMAKE_BUILD_TYPE has no value
  181. # then just use the release libraries
  182. SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  183. ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
  184. SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  185. ENDIF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
  186. # if only the release version was found, set the debug variable also to the release version
  187. IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
  188. SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
  189. SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
  190. SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
  191. ENDIF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
  192. # if only the debug version was found, set the release variable also to the debug version
  193. IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
  194. SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
  195. SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
  196. SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
  197. ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
  198. IF (Boost_${basename}_LIBRARY)
  199. SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
  200. GET_FILENAME_COMPONENT(Boost_LIBRARY_DIRS "${Boost_${basename}_LIBRARY}" PATH)
  201. SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
  202. SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
  203. ENDIF (Boost_${basename}_LIBRARY)
  204. ENDIF (Boost_INCLUDE_DIR )
  205. # Make variables changeble to the advanced user
  206. MARK_AS_ADVANCED(
  207. Boost_${basename}_LIBRARY
  208. Boost_${basename}_LIBRARY_RELEASE
  209. Boost_${basename}_LIBRARY_DEBUG
  210. )
  211. ENDMACRO (_Boost_ADJUST_LIB_VARS)
  212. #-------------------------------------------------------------------------------
  213. SET( _boost_IN_CACHE TRUE)
  214. IF(Boost_INCLUDE_DIR)
  215. FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
  216. STRING(TOUPPER ${COMPONENT} COMPONENT)
  217. IF(NOT Boost_${COMPONENT}_FOUND)
  218. SET( _boost_IN_CACHE FALSE)
  219. ENDIF(NOT Boost_${COMPONENT}_FOUND)
  220. ENDFOREACH(COMPONENT)
  221. ELSE(Boost_INCLUDE_DIR)
  222. SET( _boost_IN_CACHE FALSE)
  223. ENDIF(Boost_INCLUDE_DIR)
  224. IF (_boost_IN_CACHE)
  225. # in cache already
  226. SET(Boost_FOUND TRUE)
  227. FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
  228. STRING(TOUPPER ${COMPONENT} COMPONENT)
  229. _Boost_ADJUST_LIB_VARS( ${COMPONENT} )
  230. SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY})
  231. ENDFOREACH(COMPONENT)
  232. SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
  233. IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  234. MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
  235. MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
  236. MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
  237. ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  238. if(Boost_DEBUG)
  239. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  240. "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
  241. "is already in the cache. For debugging messages, please clear the cache.")
  242. endif()
  243. ELSE (_boost_IN_CACHE)
  244. # Need to search for boost
  245. if(Boost_DEBUG)
  246. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  247. "boost not in cache")
  248. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  249. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  250. endif()
  251. IF(WIN32)
  252. # In windows, automatic linking is performed, so you do not have
  253. # to specify the libraries. If you are linking to a dynamic
  254. # runtime, then you can choose to link to either a static or a
  255. # dynamic Boost library, the default is to do a static link. You
  256. # can alter this for a specific library "whatever" by defining
  257. # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
  258. # linked dynamically. Alternatively you can force all Boost
  259. # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
  260. # This feature can be disabled for Boost library "whatever" by
  261. # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
  262. # BOOST_ALL_NO_LIB.
  263. # If you want to observe which libraries are being linked against
  264. # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
  265. # code to emit a #pragma message each time a library is selected
  266. # for linking.
  267. SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS
  268. "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
  269. ENDIF(WIN32)
  270. SET(_boost_INCLUDE_SEARCH_DIRS
  271. C:/boost/include
  272. "C:/boost"
  273. "$ENV{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}"
  274. "$ENV{ProgramFiles}/Boost"
  275. /sw/local/include
  276. )
  277. SET(_boost_LIBRARIES_SEARCH_DIRS
  278. C:/boost/lib
  279. "C:/boost"
  280. "$ENV{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}/lib"
  281. "$ENV{ProgramFiles}/Boost"
  282. /sw/local/lib
  283. )
  284. # If BOOST_ROOT was defined in the environment, use it.
  285. if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
  286. set(BOOST_ROOT $ENV{BOOST_ROOT})
  287. endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
  288. # If BOOSTROOT was defined in the environment, use it.
  289. if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
  290. set(BOOST_ROOT $ENV{BOOSTROOT})
  291. endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
  292. # If BOOST_INCLUDEDIR was defined in the environment, use it.
  293. IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
  294. set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
  295. ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
  296. # If BOOST_LIBRARYDIR was defined in the environment, use it.
  297. IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
  298. set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
  299. ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
  300. if(Boost_DEBUG)
  301. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  302. "Declared as CMake or Environmental Variables:")
  303. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  304. " BOOST_ROOT = ${BOOST_ROOT}")
  305. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  306. " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}")
  307. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  308. " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
  309. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  310. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  311. endif()
  312. IF( BOOST_ROOT )
  313. file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
  314. SET(_boost_INCLUDE_SEARCH_DIRS
  315. ${BOOST_ROOT}/include
  316. ${BOOST_ROOT}
  317. ${_boost_INCLUDE_SEARCH_DIRS})
  318. SET(_boost_LIBRARIES_SEARCH_DIRS
  319. ${BOOST_ROOT}/lib
  320. ${BOOST_ROOT}/stage/lib
  321. ${_boost_LIBRARIES_SEARCH_DIRS})
  322. ENDIF( BOOST_ROOT )
  323. IF( BOOST_INCLUDEDIR )
  324. file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
  325. SET(_boost_INCLUDE_SEARCH_DIRS
  326. ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
  327. ENDIF( BOOST_INCLUDEDIR )
  328. IF( BOOST_LIBRARYDIR )
  329. file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
  330. SET(_boost_LIBRARIES_SEARCH_DIRS
  331. ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
  332. ENDIF( BOOST_LIBRARYDIR )
  333. # Try to find Boost by stepping backwards through the Boost versions
  334. # we know about.
  335. IF( NOT Boost_INCLUDE_DIR )
  336. # Build a list of path suffixes for each version.
  337. SET(_boost_PATH_SUFFIXES)
  338. FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
  339. # Add in a path suffix, based on the required version, ideally
  340. # we could read this from version.hpp, but for that to work we'd
  341. # need to know the include dir already
  342. if (WIN32 AND NOT CYGWIN)
  343. set(_boost_PATH_SUFFIX boost_${_boost_VER})
  344. else (WIN32 AND NOT CYGWIN)
  345. set(_boost_PATH_SUFFIX boost-${_boost_VER})
  346. endif (WIN32 AND NOT CYGWIN)
  347. IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  348. STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
  349. _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
  350. ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
  351. STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
  352. _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
  353. ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  354. LIST(APPEND _boost_PATH_SUFFIXES "${_boost_PATH_SUFFIX}")
  355. ENDFOREACH(_boost_VER)
  356. if(Boost_DEBUG)
  357. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  358. "Include debugging info:")
  359. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  360. " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}")
  361. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  362. " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}")
  363. endif()
  364. # Look for a standard boost header file.
  365. FIND_PATH(Boost_INCLUDE_DIR
  366. NAMES boost/config.hpp
  367. HINTS ${_boost_INCLUDE_SEARCH_DIRS}
  368. PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
  369. )
  370. ENDIF( NOT Boost_INCLUDE_DIR )
  371. IF(Boost_INCLUDE_DIR)
  372. # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
  373. # Read the whole file:
  374. #
  375. SET(BOOST_VERSION 0)
  376. SET(BOOST_LIB_VERSION "")
  377. FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
  378. STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
  379. STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
  380. SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
  381. SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
  382. IF(NOT "${Boost_VERSION}" STREQUAL "0")
  383. MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
  384. MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
  385. MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
  386. set(Boost_ERROR_REASON
  387. "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
  388. ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
  389. if(Boost_DEBUG)
  390. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  391. "version.hpp reveals boost "
  392. "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  393. endif()
  394. ELSE(Boost_INCLUDE_DIR)
  395. set(Boost_ERROR_REASON
  396. "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
  397. ENDIF(Boost_INCLUDE_DIR)
  398. # Setting some more suffixes for the library
  399. SET (Boost_LIB_PREFIX "")
  400. IF ( WIN32 AND Boost_USE_STATIC_LIBS )
  401. SET (Boost_LIB_PREFIX "lib")
  402. ENDIF ( WIN32 AND Boost_USE_STATIC_LIBS )
  403. if (Boost_COMPILER)
  404. set(_boost_COMPILER ${Boost_COMPILER})
  405. if(Boost_DEBUG)
  406. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  407. "using user-specified _boost_COMPILER = ${_boost_COMPILER}")
  408. endif()
  409. else(Boost_COMPILER)
  410. # Attempt to guess the compiler suffix
  411. SET (_boost_COMPILER "-gcc")
  412. IF (MSVC90)
  413. SET (_boost_COMPILER "-vc90")
  414. ELSEIF (MSVC80)
  415. SET (_boost_COMPILER "-vc80")
  416. ELSEIF (MSVC71)
  417. SET (_boost_COMPILER "-vc71")
  418. ENDIF(MSVC90)
  419. IF (MINGW)
  420. EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
  421. ARGS -dumpversion
  422. OUTPUT_VARIABLE _boost_COMPILER_VERSION
  423. )
  424. STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
  425. _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
  426. SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
  427. ENDIF(MINGW)
  428. IF (UNIX)
  429. IF (NOT CMAKE_COMPILER_IS_GNUCC)
  430. # We assume that we have the Intel compiler.
  431. SET (_boost_COMPILER "-il")
  432. ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
  433. # Determine which version of GCC we have.
  434. EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
  435. ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
  436. OUTPUT_VARIABLE _boost_COMPILER_VERSION
  437. )
  438. STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
  439. _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
  440. IF(APPLE)
  441. IF(Boost_MINOR_VERSION)
  442. IF(${Boost_MINOR_VERSION} GREATER 35)
  443. # In Boost 1.36.0 and newer, the mangled compiler name used
  444. # on Mac OS X/Darwin is "xgcc".
  445. SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
  446. ELSE(${Boost_MINOR_VERSION} GREATER 35)
  447. # In Boost <= 1.35.0, there is no mangled compiler name for
  448. # the Mac OS X/Darwin version of GCC.
  449. SET(_boost_COMPILER "")
  450. ENDIF(${Boost_MINOR_VERSION} GREATER 35)
  451. ELSE(Boost_MINOR_VERSION)
  452. # We don't know the Boost version, so assume it's
  453. # pre-1.36.0.
  454. SET(_boost_COMPILER "")
  455. ENDIF(Boost_MINOR_VERSION)
  456. ELSE()
  457. SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
  458. ENDIF()
  459. ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
  460. ENDIF(UNIX)
  461. if(Boost_DEBUG)
  462. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  463. "guessed _boost_COMPILER = ${_boost_COMPILER}")
  464. endif()
  465. endif(Boost_COMPILER)
  466. SET (_boost_MULTITHREADED "-mt")
  467. IF( NOT Boost_USE_MULTITHREADED )
  468. SET (_boost_MULTITHREADED "")
  469. ENDIF( NOT Boost_USE_MULTITHREADED )
  470. if(Boost_DEBUG)
  471. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  472. "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
  473. endif()
  474. SET( _boost_STATIC_TAG "")
  475. IF (WIN32)
  476. IF(MSVC)
  477. SET (_boost_ABI_TAG "g")
  478. ENDIF(MSVC)
  479. IF( Boost_USE_STATIC_LIBS )
  480. SET( _boost_STATIC_TAG "-s")
  481. ENDIF( Boost_USE_STATIC_LIBS )
  482. ENDIF(WIN32)
  483. SET (_boost_ABI_TAG "${_boost_ABI_TAG}d")
  484. if(Boost_DEBUG)
  485. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  486. "_boost_STATIC_TAG = ${_boost_STATIC_TAG}")
  487. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  488. "_boost_ABI_TAG = ${_boost_ABI_TAG}")
  489. endif()
  490. # ------------------------------------------------------------------------
  491. # Begin finding boost libraries
  492. # ------------------------------------------------------------------------
  493. if(Boost_DEBUG)
  494. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  495. "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}")
  496. endif()
  497. FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
  498. STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  499. SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
  500. SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
  501. SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
  502. # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  503. IF( Boost_USE_STATIC_LIBS )
  504. SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  505. IF(WIN32)
  506. SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  507. ELSE(WIN32)
  508. SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  509. ENDIF(WIN32)
  510. ENDIF( Boost_USE_STATIC_LIBS )
  511. FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
  512. NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
  513. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
  514. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
  515. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
  516. ${Boost_LIB_PREFIX}boost_${COMPONENT}
  517. HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
  518. )
  519. FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
  520. NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
  521. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
  522. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
  523. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
  524. ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
  525. HINTS ${_boost_LIBRARIES_SEARCH_DIRS}
  526. )
  527. _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
  528. IF( Boost_USE_STATIC_LIBS )
  529. SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  530. ENDIF( Boost_USE_STATIC_LIBS )
  531. ENDFOREACH(COMPONENT)
  532. # ------------------------------------------------------------------------
  533. # End finding boost libraries
  534. # ------------------------------------------------------------------------
  535. SET(Boost_INCLUDE_DIRS
  536. ${Boost_INCLUDE_DIR}
  537. )
  538. SET(Boost_FOUND FALSE)
  539. IF(Boost_INCLUDE_DIR)
  540. SET( Boost_FOUND TRUE )
  541. # Check the version of Boost against the requested version.
  542. if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  543. message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34")
  544. endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  545. if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
  546. set( Boost_FOUND FALSE )
  547. set(_Boost_VERSION_AGE "old")
  548. elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  549. if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
  550. set( Boost_FOUND FALSE )
  551. set(_Boost_VERSION_AGE "old")
  552. elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  553. if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
  554. set( Boost_FOUND FALSE )
  555. set(_Boost_VERSION_AGE "old")
  556. endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
  557. endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
  558. endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
  559. if (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
  560. # If the user requested an exact version of Boost, check
  561. # that. We already know that the Boost version we have is >= the
  562. # requested version.
  563. set(_Boost_VERSION_AGE "new")
  564. # If the user didn't specify a patchlevel, it's 0.
  565. if (NOT Boost_FIND_VERSION_PATCH)
  566. set(Boost_FIND_VERSION_PATCH 0)
  567. endif (NOT Boost_FIND_VERSION_PATCH)
  568. # We'll set Boost_FOUND true again if we have an exact version match.
  569. set(Boost_FOUND FALSE)
  570. if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  571. if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  572. if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
  573. set( Boost_FOUND TRUE )
  574. endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
  575. endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  576. endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  577. endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
  578. if(NOT Boost_FOUND)
  579. # State that we found a version of Boost that is too new or too old.
  580. set(Boost_ERROR_REASON
  581. "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  582. if (Boost_FIND_VERSION_PATCH)
  583. set(Boost_ERROR_REASON
  584. "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
  585. endif (Boost_FIND_VERSION_PATCH)
  586. if (NOT Boost_FIND_VERSION_EXACT)
  587. set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
  588. endif (NOT Boost_FIND_VERSION_EXACT)
  589. set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
  590. endif (NOT Boost_FOUND)
  591. if (Boost_FOUND)
  592. set(_boost_CHECKED_COMPONENT FALSE)
  593. set(_Boost_MISSING_COMPONENTS)
  594. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  595. string(TOUPPER ${COMPONENT} COMPONENT)
  596. set(_boost_CHECKED_COMPONENT TRUE)
  597. if(NOT Boost_${COMPONENT}_FOUND)
  598. string(TOLOWER ${COMPONENT} COMPONENT)
  599. list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
  600. set( Boost_FOUND FALSE)
  601. endif(NOT Boost_${COMPONENT}_FOUND)
  602. endforeach(COMPONENT)
  603. endif (Boost_FOUND)
  604. if(Boost_DEBUG)
  605. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
  606. endif()
  607. if (_Boost_MISSING_COMPONENTS)
  608. # We were unable to find some libraries, so generate a sensible
  609. # error message that lists the libraries we were unable to find.
  610. set(Boost_ERROR_REASON
  611. "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n")
  612. foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
  613. set(Boost_ERROR_REASON
  614. "${Boost_ERROR_REASON} boost_${COMPONENT}\n")
  615. endforeach(COMPONENT)
  616. list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
  617. list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
  618. if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  619. set(Boost_ERROR_REASON
  620. "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
  621. else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  622. set(Boost_ERROR_REASON
  623. "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
  624. endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  625. endif (_Boost_MISSING_COMPONENTS)
  626. IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
  627. # Compatibility Code for backwards compatibility with CMake
  628. # 2.4's FindBoost module.
  629. # Look for the boost library path.
  630. # Note that the user may not have installed any libraries
  631. # so it is quite possible the Boost_LIBRARY_PATH may not exist.
  632. SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
  633. IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
  634. GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  635. ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
  636. IF("${_boost_LIB_DIR}" MATCHES "/include$")
  637. # Strip off the trailing "/include" in the path.
  638. GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  639. ENDIF("${_boost_LIB_DIR}" MATCHES "/include$")
  640. IF(EXISTS "${_boost_LIB_DIR}/lib")
  641. SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
  642. ELSE(EXISTS "${_boost_LIB_DIR}/lib")
  643. IF(EXISTS "${_boost_LIB_DIR}/stage/lib")
  644. SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib)
  645. ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib")
  646. SET(_boost_LIB_DIR "")
  647. ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib")
  648. ENDIF(EXISTS "${_boost_LIB_DIR}/lib")
  649. IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
  650. SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
  651. ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
  652. ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
  653. ELSE(Boost_INCLUDE_DIR)
  654. SET( Boost_FOUND FALSE)
  655. ENDIF(Boost_INCLUDE_DIR)
  656. IF (Boost_FOUND)
  657. IF (NOT Boost_FIND_QUIETLY)
  658. MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  659. ENDIF(NOT Boost_FIND_QUIETLY)
  660. IF (NOT Boost_FIND_QUIETLY)
  661. MESSAGE(STATUS "Found the following Boost libraries:")
  662. ENDIF(NOT Boost_FIND_QUIETLY)
  663. FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} )
  664. STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT )
  665. IF ( Boost_${UPPERCOMPONENT}_FOUND )
  666. IF (NOT Boost_FIND_QUIETLY)
  667. MESSAGE (STATUS " ${COMPONENT}")
  668. ENDIF(NOT Boost_FIND_QUIETLY)
  669. SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
  670. ENDIF ( Boost_${UPPERCOMPONENT}_FOUND )
  671. ENDFOREACH(COMPONENT)
  672. ELSE (Boost_FOUND)
  673. IF (Boost_FIND_REQUIRED)
  674. message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
  675. ENDIF(Boost_FIND_REQUIRED)
  676. ENDIF(Boost_FOUND)
  677. # Under Windows, automatic linking is performed, so no need to specify the libraries.
  678. IF (WIN32)
  679. IF (NOT MINGW)
  680. SET(Boost_LIBRARIES "")
  681. ENDIF (NOT MINGW)
  682. ENDIF(WIN32)
  683. # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
  684. MARK_AS_ADVANCED(Boost_INCLUDE_DIR
  685. Boost_INCLUDE_DIRS
  686. Boost_LIBRARY_DIRS
  687. Boost_USE_MULTITHREADED
  688. )
  689. ENDIF(_boost_IN_CACHE)