FindBoost.cmake 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. # - Try to find Boost include dirs and libraries
  2. # Usage of this module as follows:
  3. #
  4. # NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below.
  5. # Due to Boost naming conventions and limitations in CMake this find
  6. # module is NOT future safe with respect to Boost version numbers,
  7. # and may break.
  8. #
  9. # == Using Header-Only libraries from within Boost: ==
  10. #
  11. # find_package( Boost 1.36.0 )
  12. # if(Boost_FOUND)
  13. # include_directories(${Boost_INCLUDE_DIRS})
  14. # add_executable(foo foo.cc)
  15. # endif()
  16. #
  17. #
  18. # == Using actual libraries from within Boost: ==
  19. #
  20. # set(Boost_USE_STATIC_LIBS ON)
  21. # set(Boost_USE_MULTITHREADED ON)
  22. # set(Boost_USE_STATIC_RUNTIME OFF)
  23. # find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... )
  24. #
  25. # if(Boost_FOUND)
  26. # include_directories(${Boost_INCLUDE_DIRS})
  27. # add_executable(foo foo.cc)
  28. # target_link_libraries(foo ${Boost_LIBRARIES})
  29. # endif()
  30. #
  31. #
  32. # The components list needs to contain actual names of boost libraries only,
  33. # such as "date_time" for "libboost_date_time". If you're using parts of
  34. # Boost that contain header files only (e.g. foreach) you do not need to
  35. # specify COMPONENTS.
  36. #
  37. # You should provide a minimum version number that should be used. If you provide this
  38. # version number and specify the REQUIRED attribute, this module will fail if it
  39. # can't find the specified or a later version. If you specify a version number this is
  40. # automatically put into the considered list of version numbers and thus doesn't need
  41. # to be specified in the Boost_ADDITIONAL_VERSIONS variable (see below).
  42. #
  43. # NOTE for Visual Studio Users:
  44. # Automatic linking is used on MSVC & Borland compilers by default when
  45. # #including things in Boost. It's important to note that setting
  46. # Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking,
  47. # should you need this feature. Automatic linking typically uses static
  48. # libraries with a few exceptions (Boost.Python is one).
  49. #
  50. # Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for
  51. # more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example
  52. # above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS
  53. # gets set to OFF. It is suggested you avoid automatic linking since it
  54. # will make your application less portable.
  55. #
  56. # =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============
  57. #
  58. # OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
  59. # boost version numbers that should be taken into account when searching
  60. # for Boost. Unfortunately boost puts the version number into the
  61. # actual filename for the libraries, so this variable will certainly be needed
  62. # in the future when new Boost versions are released.
  63. #
  64. # Currently this module searches for the following version numbers:
  65. # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
  66. # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
  67. # 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0,
  68. # 1.45, 1.45.0, 1.46, 1.46.0, 1.46.1, 1.47, 1.47.0, 1.48, 1.48.0
  69. #
  70. # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
  71. # add both 1.x and 1.x.0 as shown above. Official Boost include directories
  72. # omit the 3rd version number from include paths if it is 0 although not all
  73. # binary Boost releases do so.
  74. #
  75. # set(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
  76. #
  77. # ===================================== ============= ========================
  78. #
  79. # Variables used by this module, they can change the default behaviour and
  80. # need to be set before calling find_package:
  81. #
  82. # Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded
  83. # boost libraries. If not specified, defaults
  84. # to ON.
  85. #
  86. # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
  87. # boost libraries. Defaults to OFF.
  88. #
  89. # Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system
  90. # paths (or other locations outside of BOOST_ROOT
  91. # or BOOST_INCLUDEDIR). Useful when specifying
  92. # BOOST_ROOT. Defaults to OFF.
  93. # [Since CMake 2.8.3]
  94. #
  95. # Boost_NO_BOOST_CMAKE Do not do a find_package call in config mode
  96. # before searching for a regular boost install.
  97. # This will avoid finding boost-cmake installs.
  98. # Defaults to OFF.
  99. # [Since CMake 2.8.6]
  100. #
  101. # Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries
  102. # linked against a static C++ standard library
  103. # ('s' ABI tag). This option should be set to
  104. # ON or OFF because the default behavior
  105. # if not specified is platform dependent
  106. # for backwards compatibility.
  107. # [Since CMake 2.8.3]
  108. #
  109. # Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries
  110. # compiled against a special debug build of
  111. # Python ('y' ABI tag). Defaults to OFF.
  112. # [Since CMake 2.8.3]
  113. #
  114. # Boost_USE_STLPORT If enabled, searches for boost libraries
  115. # compiled against the STLPort standard
  116. # library ('p' ABI tag). Defaults to OFF.
  117. # [Since CMake 2.8.3]
  118. #
  119. # Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
  120. # If enabled, searches for boost libraries
  121. # compiled against the deprecated STLPort
  122. # "native iostreams" feature ('n' ABI tag).
  123. # Defaults to OFF.
  124. # [Since CMake 2.8.3]
  125. #
  126. # Other Variables used by this module which you may want to set.
  127. #
  128. # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
  129. # the boost include directory. Please see
  130. # the documentation above regarding this
  131. # annoying, but necessary variable :(
  132. #
  133. # Boost_DEBUG Set this to TRUE to enable debugging output
  134. # of FindBoost.cmake if you are having problems.
  135. # Please enable this before filing any bug
  136. # reports.
  137. #
  138. # Boost_DETAILED_FAILURE_MSG FindBoost doesn't output detailed information
  139. # about why it failed or how to fix the problem
  140. # unless this is set to TRUE or the REQUIRED
  141. # keyword is specified in find_package().
  142. # [Since CMake 2.8.0]
  143. #
  144. # Boost_COMPILER Set this to the compiler suffix used by Boost
  145. # (e.g. "-gcc43") if FindBoost has problems finding
  146. # the proper Boost installation
  147. #
  148. # Boost_THREADAPI When building boost.thread, sometimes the name of the
  149. # library contains an additional "pthread" or "win32"
  150. # string known as the threadapi. This can happen when
  151. # compiling against pthreads on Windows or win32 threads
  152. # on Cygwin. You may specify this variable and if set
  153. # when FindBoost searches for the Boost threading library
  154. # it will first try to match the threadapi you specify.
  155. # For Example: libboost_thread_win32-mgw45-mt-1_43.a
  156. # might be found if you specified "win32" here before
  157. # falling back on libboost_thread-mgw45-mt-1_43.a.
  158. # [Since CMake 2.8.3]
  159. #
  160. # Boost_REALPATH Resolves symbolic links for discovered boost libraries
  161. # to assist with packaging. For example, instead of
  162. # Boost_SYSTEM_LIBRARY_RELEASE being resolved to
  163. # "/usr/lib/libboost_system.so" it would be
  164. # "/usr/lib/libboost_system.so.1.42.0" instead.
  165. # This does not affect linking and should not be
  166. # enabled unless the user needs this information.
  167. # [Since CMake 2.8.3]
  168. #
  169. #
  170. # These last three variables are available also as environment variables:
  171. # Also, note they are completely UPPERCASE, except Boost_DIR.
  172. #
  173. # Boost_DIR or The preferred installation prefix for searching for
  174. # BOOST_ROOT or BOOSTROOT Boost. Set this if the module has problems finding
  175. # the proper Boost installation.
  176. #
  177. # Note that Boost_DIR behaves exactly as <package>_DIR
  178. # variables are documented to behave in find_package's
  179. # Config mode. That is, if it is set as a -D argument
  180. # to CMake, it must point to the location of the
  181. # BoostConfig.cmake or Boost-config.cmake file. If it
  182. # is set as an environment variable, it must point to
  183. # the root of the boost installation. BOOST_ROOT and
  184. # BOOSTROOT, on the other hand, will point to the root
  185. # in either case.
  186. #
  187. # To prevent falling back on the system paths, set
  188. # Boost_NO_SYSTEM_PATHS to true.
  189. #
  190. # To avoid finding boost-cmake installations, set
  191. # Boost_NO_BOOST_CMAKE to true.
  192. #
  193. # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
  194. # module has problems finding the proper Boost installation
  195. #
  196. # BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the
  197. # module has problems finding the proper Boost installation
  198. #
  199. # Variables defined by this module:
  200. #
  201. # Boost_FOUND System has Boost, this means the include dir was
  202. # found, as well as all the libraries specified in
  203. # the COMPONENTS list.
  204. #
  205. # Boost_INCLUDE_DIRS Boost include directories: not cached
  206. #
  207. # Boost_INCLUDE_DIR This is almost the same as above, but this one is
  208. # cached and may be modified by advanced users
  209. #
  210. # Boost_LIBRARIES Link to these to use the Boost libraries that you
  211. # specified: not cached
  212. #
  213. # Boost_LIBRARY_DIRS The path to where the Boost library files are.
  214. #
  215. # Boost_VERSION The version number of the boost libraries that
  216. # have been found, same as in version.hpp from Boost
  217. #
  218. # Boost_LIB_VERSION The version number in filename form as
  219. # it's appended to the library filenames
  220. #
  221. # Boost_MAJOR_VERSION major version number of boost
  222. # Boost_MINOR_VERSION minor version number of boost
  223. # Boost_SUBMINOR_VERSION subminor version number of boost
  224. #
  225. # Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call
  226. # add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
  227. # to have diagnostic information about Boost's
  228. # automatic linking outputted during compilation time.
  229. #
  230. # For each component you specify in find_package(), the following (UPPER-CASE)
  231. # variables are set. You can use these variables if you would like to pick and
  232. # choose components for your targets instead of just using Boost_LIBRARIES.
  233. #
  234. # Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found.
  235. #
  236. # Boost_${COMPONENT}_LIBRARY Contains the libraries for the specified Boost
  237. # "component" (includes debug and optimized keywords
  238. # when needed).
  239. #=============================================================================
  240. # Copyright 2006-2009 Kitware, Inc.
  241. # Copyright 2006-2008 Andreas Schneider <[email protected]>
  242. # Copyright 2007 Wengo
  243. # Copyright 2007 Mike Jackson
  244. # Copyright 2008 Andreas Pakulat <[email protected]>
  245. # Copyright 2008-2010 Philip Lowman <[email protected]>
  246. #
  247. # Distributed under the OSI-approved BSD License (the "License");
  248. # see accompanying file Copyright.txt for details.
  249. #
  250. # This software is distributed WITHOUT ANY WARRANTY; without even the
  251. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  252. # See the License for more information.
  253. #=============================================================================
  254. # (To distribute this file outside of CMake, substitute the full
  255. # License text for the above reference.)
  256. #-------------------------------------------------------------------------------
  257. # Before we go searching, check whether boost-cmake is avaialble, unless the
  258. # user specifically asked NOT to search for boost-cmake.
  259. #
  260. # If Boost_DIR is set, this behaves as any find_package call would. If not,
  261. # it looks at BOOST_ROOT and BOOSTROOT to find Boost.
  262. #
  263. if (NOT Boost_NO_BOOST_CMAKE)
  264. # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives,
  265. # since these are more conventional for Boost.
  266. if ("$ENV{Boost_DIR}" STREQUAL "")
  267. if (NOT "$ENV{BOOST_ROOT}" STREQUAL "")
  268. set(ENV{Boost_DIR} $ENV{BOOST_ROOT})
  269. elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "")
  270. set(ENV{Boost_DIR} $ENV{BOOSTROOT})
  271. endif()
  272. endif()
  273. # Do the same find_package call but look specifically for the CMake version.
  274. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
  275. # need to delegate them to this find_package call.
  276. find_package(Boost QUIET NO_MODULE)
  277. # If we found boost-cmake, then we're done. Print out what we found.
  278. # Otherwise let the rest of the module try to find it.
  279. if (Boost_FOUND)
  280. message("Boost ${Boost_FIND_VERSION} found.")
  281. if (Boost_FIND_COMPONENTS)
  282. message("Found Boost components:")
  283. message(" ${Boost_FIND_COMPONENTS}")
  284. endif()
  285. return()
  286. endif()
  287. endif()
  288. #-------------------------------------------------------------------------------
  289. # FindBoost functions & macros
  290. #
  291. ############################################
  292. #
  293. # Check the existence of the libraries.
  294. #
  295. ############################################
  296. # This macro was taken directly from the FindQt4.cmake file that is included
  297. # with the CMake distribution. This is NOT my work. All work was done by the
  298. # original authors of the FindQt4.cmake file. Only minor modifications were
  299. # made to remove references to Qt and make this file more generally applicable
  300. # And ELSE/ENDIF pairs were removed for readability.
  301. #########################################################################
  302. macro(_Boost_ADJUST_LIB_VARS basename)
  303. if(Boost_INCLUDE_DIR )
  304. if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
  305. # if the generator supports configuration types then set
  306. # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
  307. if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
  308. set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  309. else()
  310. # if there are no configuration types and CMAKE_BUILD_TYPE has no value
  311. # then just use the release libraries
  312. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  313. endif()
  314. # FIXME: This probably should be set for both cases
  315. set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  316. endif()
  317. # if only the release version was found, set the debug variable also to the release version
  318. if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
  319. set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
  320. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
  321. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
  322. endif()
  323. # if only the debug version was found, set the release variable also to the debug version
  324. if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
  325. set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
  326. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
  327. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
  328. endif()
  329. # If the debug & release library ends up being the same, omit the keywords
  330. if(${Boost_${basename}_LIBRARY_RELEASE} STREQUAL ${Boost_${basename}_LIBRARY_DEBUG})
  331. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  332. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
  333. endif()
  334. if(Boost_${basename}_LIBRARY)
  335. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
  336. # Remove superfluous "debug" / "optimized" keywords from
  337. # Boost_LIBRARY_DIRS
  338. foreach(_boost_my_lib ${Boost_${basename}_LIBRARY})
  339. get_filename_component(_boost_my_lib_path "${_boost_my_lib}" PATH)
  340. list(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path})
  341. endforeach()
  342. list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
  343. set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
  344. set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
  345. endif(Boost_${basename}_LIBRARY)
  346. endif(Boost_INCLUDE_DIR )
  347. # Make variables changeble to the advanced user
  348. mark_as_advanced(
  349. Boost_${basename}_LIBRARY
  350. Boost_${basename}_LIBRARY_RELEASE
  351. Boost_${basename}_LIBRARY_DEBUG
  352. )
  353. endmacro(_Boost_ADJUST_LIB_VARS)
  354. #-------------------------------------------------------------------------------
  355. #
  356. # Runs compiler with "-dumpversion" and parses major/minor
  357. # version with a regex.
  358. #
  359. function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
  360. exec_program(${CMAKE_CXX_COMPILER}
  361. ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
  362. OUTPUT_VARIABLE _boost_COMPILER_VERSION
  363. )
  364. string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
  365. _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
  366. set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
  367. endfunction()
  368. #
  369. # A convenience function for marking desired components
  370. # as found or not
  371. #
  372. function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no)
  373. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  374. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  375. set(Boost_${UPPERCOMPONENT}_FOUND ${_yes_or_no} CACHE INTERNAL "Whether the Boost ${COMPONENT} library found" FORCE)
  376. endforeach()
  377. endfunction()
  378. #
  379. # Take a list of libraries with "thread" in it
  380. # and prepend duplicates with "thread_${Boost_THREADAPI}"
  381. # at the front of the list
  382. #
  383. function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
  384. set(_orig_libnames ${ARGN})
  385. string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames ${_orig_libnames})
  386. set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
  387. endfunction()
  388. #
  389. # If a library is found, replace its cache entry with its REALPATH
  390. #
  391. function(_Boost_SWAP_WITH_REALPATH _library _docstring)
  392. if(${_library})
  393. get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
  394. unset(${_library} CACHE)
  395. set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
  396. endif()
  397. endfunction()
  398. function(_Boost_CHECK_SPELLING _var)
  399. if(${_var})
  400. string(TOUPPER ${_var} _var_UC)
  401. message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.")
  402. endif()
  403. endfunction()
  404. #
  405. # End functions/macros
  406. #
  407. #-------------------------------------------------------------------------------
  408. if(NOT DEFINED Boost_USE_MULTITHREADED)
  409. set(Boost_USE_MULTITHREADED TRUE)
  410. endif()
  411. if(Boost_FIND_VERSION_EXACT)
  412. # The version may appear in a directory with or without the patch
  413. # level, even when the patch level is non-zero.
  414. set(_boost_TEST_VERSIONS
  415. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
  416. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  417. else(Boost_FIND_VERSION_EXACT)
  418. # The user has not requested an exact version. Among known
  419. # versions, find those that are acceptable to the user request.
  420. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
  421. "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
  422. "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
  423. "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
  424. "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
  425. "1.34" "1.33.1" "1.33.0" "1.33")
  426. set(_boost_TEST_VERSIONS)
  427. if(Boost_FIND_VERSION)
  428. set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  429. # Select acceptable versions.
  430. foreach(version ${_Boost_KNOWN_VERSIONS})
  431. if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
  432. # This version is high enough.
  433. list(APPEND _boost_TEST_VERSIONS "${version}")
  434. elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
  435. # This version is a short-form for the requested version with
  436. # the patch level dropped.
  437. list(APPEND _boost_TEST_VERSIONS "${version}")
  438. endif()
  439. endforeach(version)
  440. else(Boost_FIND_VERSION)
  441. # Any version is acceptable.
  442. set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
  443. endif(Boost_FIND_VERSION)
  444. endif(Boost_FIND_VERSION_EXACT)
  445. # The reason that we failed to find Boost. This will be set to a
  446. # user-friendly message when we fail to find some necessary piece of
  447. # Boost.
  448. set(Boost_ERROR_REASON)
  449. set( _boost_IN_CACHE TRUE)
  450. if(Boost_INCLUDE_DIR)
  451. # On versions < 1.35, remove the System library from the considered list
  452. # since it wasn't added until 1.35.
  453. if(Boost_VERSION AND Boost_FIND_COMPONENTS)
  454. if(Boost_VERSION LESS 103500)
  455. list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
  456. endif()
  457. endif()
  458. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  459. string(TOUPPER ${COMPONENT} COMPONENT)
  460. if(NOT Boost_${COMPONENT}_FOUND)
  461. set( _boost_IN_CACHE FALSE)
  462. endif(NOT Boost_${COMPONENT}_FOUND)
  463. endforeach(COMPONENT)
  464. else(Boost_INCLUDE_DIR)
  465. set( _boost_IN_CACHE FALSE)
  466. endif(Boost_INCLUDE_DIR)
  467. if(_boost_IN_CACHE)
  468. # in cache already
  469. set(Boost_FOUND TRUE)
  470. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  471. string(TOUPPER ${COMPONENT} COMPONENT)
  472. _Boost_ADJUST_LIB_VARS( ${COMPONENT} )
  473. set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY})
  474. endforeach(COMPONENT)
  475. set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
  476. if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  477. math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
  478. math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
  479. math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
  480. endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  481. if(Boost_DEBUG)
  482. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  483. "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
  484. "is already in the cache. To view debugging messages, please clear the cache.")
  485. endif()
  486. else(_boost_IN_CACHE)
  487. # Need to search for boost
  488. if(Boost_DEBUG)
  489. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  490. "Boost not in cache")
  491. # Output some of their choices
  492. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  493. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  494. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  495. "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}")
  496. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  497. "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}")
  498. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  499. "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
  500. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  501. "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
  502. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  503. "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
  504. endif()
  505. if(WIN32)
  506. # In windows, automatic linking is performed, so you do not have
  507. # to specify the libraries. If you are linking to a dynamic
  508. # runtime, then you can choose to link to either a static or a
  509. # dynamic Boost library, the default is to do a static link. You
  510. # can alter this for a specific library "whatever" by defining
  511. # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
  512. # linked dynamically. Alternatively you can force all Boost
  513. # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
  514. # This feature can be disabled for Boost library "whatever" by
  515. # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
  516. # BOOST_ALL_NO_LIB.
  517. # If you want to observe which libraries are being linked against
  518. # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
  519. # code to emit a #pragma message each time a library is selected
  520. # for linking.
  521. set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
  522. "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
  523. endif(WIN32)
  524. set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
  525. C:/boost/include
  526. C:/boost
  527. "$ENV{ProgramFiles}/boost/include"
  528. "$ENV{ProgramFiles}/boost"
  529. /sw/local/include
  530. )
  531. _Boost_CHECK_SPELLING(Boost_ROOT)
  532. _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
  533. _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
  534. # If BOOST_ROOT was defined in the environment, use it.
  535. if (NOT BOOST_ROOT AND NOT $ENV{Boost_DIR} STREQUAL "")
  536. set(BOOST_ROOT $ENV{Boost_DIR})
  537. endif()
  538. # If BOOST_ROOT was defined in the environment, use it.
  539. if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "")
  540. set(BOOST_ROOT $ENV{BOOST_ROOT})
  541. endif()
  542. # If BOOSTROOT was defined in the environment, use it.
  543. if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "")
  544. set(BOOST_ROOT $ENV{BOOSTROOT})
  545. endif()
  546. # If BOOST_INCLUDEDIR was defined in the environment, use it.
  547. if( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
  548. set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
  549. endif()
  550. # If BOOST_LIBRARYDIR was defined in the environment, use it.
  551. if( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
  552. set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
  553. endif()
  554. if( BOOST_ROOT )
  555. file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
  556. endif()
  557. if(Boost_DEBUG)
  558. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  559. "Declared as CMake or Environmental Variables:")
  560. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  561. " BOOST_ROOT = ${BOOST_ROOT}")
  562. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  563. " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}")
  564. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  565. " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
  566. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  567. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  568. endif()
  569. if( Boost_NO_SYSTEM_PATHS)
  570. set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
  571. else()
  572. set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM})
  573. endif()
  574. if( BOOST_ROOT )
  575. set(_boost_INCLUDE_SEARCH_DIRS
  576. ${BOOST_ROOT}/include
  577. ${BOOST_ROOT}
  578. ${_boost_INCLUDE_SEARCH_DIRS})
  579. endif()
  580. # prepend BOOST_INCLUDEDIR to search path if specified
  581. if( BOOST_INCLUDEDIR )
  582. file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
  583. set(_boost_INCLUDE_SEARCH_DIRS
  584. ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
  585. endif( BOOST_INCLUDEDIR )
  586. # ------------------------------------------------------------------------
  587. # Search for Boost include DIR
  588. # ------------------------------------------------------------------------
  589. # Try to find Boost by stepping backwards through the Boost versions
  590. # we know about.
  591. if( NOT Boost_INCLUDE_DIR )
  592. # Build a list of path suffixes for each version.
  593. set(_boost_PATH_SUFFIXES)
  594. foreach(_boost_VER ${_boost_TEST_VERSIONS})
  595. # Add in a path suffix, based on the required version, ideally
  596. # we could read this from version.hpp, but for that to work we'd
  597. # need to know the include dir already
  598. set(_boost_BOOSTIFIED_VERSION)
  599. # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
  600. if(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
  601. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
  602. _boost_BOOSTIFIED_VERSION ${_boost_VER})
  603. elseif(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
  604. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
  605. _boost_BOOSTIFIED_VERSION ${_boost_VER})
  606. endif()
  607. list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
  608. list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
  609. endforeach(_boost_VER)
  610. if(Boost_DEBUG)
  611. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  612. "Include debugging info:")
  613. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  614. " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}")
  615. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  616. " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}")
  617. endif()
  618. # Look for a standard boost header file.
  619. find_path(Boost_INCLUDE_DIR
  620. NAMES boost/config.hpp
  621. HINTS ${_boost_INCLUDE_SEARCH_DIRS}
  622. PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
  623. ${_boost_FIND_OPTIONS}
  624. )
  625. endif( NOT Boost_INCLUDE_DIR )
  626. # ------------------------------------------------------------------------
  627. # Extract version information from version.hpp
  628. # ------------------------------------------------------------------------
  629. if(Boost_INCLUDE_DIR)
  630. # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
  631. # Read the whole file:
  632. #
  633. set(BOOST_VERSION 0)
  634. set(BOOST_LIB_VERSION "")
  635. file(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
  636. if(Boost_DEBUG)
  637. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  638. "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
  639. endif()
  640. string(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
  641. string(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
  642. set(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
  643. set(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
  644. if(NOT "${Boost_VERSION}" STREQUAL "0")
  645. math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
  646. math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
  647. math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
  648. set(Boost_ERROR_REASON
  649. "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
  650. endif(NOT "${Boost_VERSION}" STREQUAL "0")
  651. if(Boost_DEBUG)
  652. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  653. "version.hpp reveals boost "
  654. "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  655. endif()
  656. else(Boost_INCLUDE_DIR)
  657. set(Boost_ERROR_REASON
  658. "${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.")
  659. endif(Boost_INCLUDE_DIR)
  660. # ------------------------------------------------------------------------
  661. # Suffix initialization and compiler suffix detection.
  662. # ------------------------------------------------------------------------
  663. # Setting some more suffixes for the library
  664. set(Boost_LIB_PREFIX "")
  665. if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN)
  666. set(Boost_LIB_PREFIX "lib")
  667. endif()
  668. if (Boost_COMPILER)
  669. set(_boost_COMPILER ${Boost_COMPILER})
  670. if(Boost_DEBUG)
  671. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  672. "using user-specified Boost_COMPILER = ${_boost_COMPILER}")
  673. endif()
  674. else(Boost_COMPILER)
  675. # Attempt to guess the compiler suffix
  676. # NOTE: this is not perfect yet, if you experience any issues
  677. # please report them and use the Boost_COMPILER variable
  678. # to work around the problems.
  679. if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"
  680. OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
  681. OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
  682. if(WIN32)
  683. set (_boost_COMPILER "-iw")
  684. else()
  685. set (_boost_COMPILER "-il")
  686. endif()
  687. elseif (MSVC11)
  688. set(_boost_COMPILER "-vc110")
  689. elseif (MSVC10)
  690. set(_boost_COMPILER "-vc100")
  691. elseif (MSVC90)
  692. set(_boost_COMPILER "-vc90")
  693. elseif (MSVC80)
  694. set(_boost_COMPILER "-vc80")
  695. elseif (MSVC71)
  696. set(_boost_COMPILER "-vc71")
  697. elseif (MSVC70) # Good luck!
  698. set(_boost_COMPILER "-vc7") # yes, this is correct
  699. elseif (MSVC60) # Good luck!
  700. set(_boost_COMPILER "-vc6") # yes, this is correct
  701. elseif (BORLAND)
  702. set(_boost_COMPILER "-bcb")
  703. elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro")
  704. set(_boost_COMPILER "-sw")
  705. elseif (MINGW)
  706. if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
  707. set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
  708. else()
  709. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
  710. set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
  711. endif()
  712. elseif (UNIX)
  713. if (CMAKE_COMPILER_IS_GNUCXX)
  714. if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
  715. set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
  716. else()
  717. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
  718. # Determine which version of GCC we have.
  719. if(APPLE)
  720. if(Boost_MINOR_VERSION)
  721. if(${Boost_MINOR_VERSION} GREATER 35)
  722. # In Boost 1.36.0 and newer, the mangled compiler name used
  723. # on Mac OS X/Darwin is "xgcc".
  724. set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
  725. else(${Boost_MINOR_VERSION} GREATER 35)
  726. # In Boost <= 1.35.0, there is no mangled compiler name for
  727. # the Mac OS X/Darwin version of GCC.
  728. set(_boost_COMPILER "")
  729. endif(${Boost_MINOR_VERSION} GREATER 35)
  730. else(Boost_MINOR_VERSION)
  731. # We don't know the Boost version, so assume it's
  732. # pre-1.36.0.
  733. set(_boost_COMPILER "")
  734. endif(Boost_MINOR_VERSION)
  735. else()
  736. set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
  737. endif()
  738. endif()
  739. endif (CMAKE_COMPILER_IS_GNUCXX)
  740. endif()
  741. if(Boost_DEBUG)
  742. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  743. "guessed _boost_COMPILER = ${_boost_COMPILER}")
  744. endif()
  745. endif(Boost_COMPILER)
  746. set (_boost_MULTITHREADED "-mt")
  747. if( NOT Boost_USE_MULTITHREADED )
  748. set (_boost_MULTITHREADED "")
  749. endif()
  750. if(Boost_DEBUG)
  751. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  752. "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
  753. endif()
  754. #======================
  755. # Systematically build up the Boost ABI tag
  756. # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming
  757. set( _boost_RELEASE_ABI_TAG "-")
  758. set( _boost_DEBUG_ABI_TAG "-")
  759. # Key Use this library when:
  760. # s linking statically to the C++ standard library and
  761. # compiler runtime support libraries.
  762. if(Boost_USE_STATIC_RUNTIME)
  763. set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
  764. set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
  765. endif()
  766. # g using debug versions of the standard and runtime
  767. # support libraries
  768. if(WIN32)
  769. if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
  770. OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
  771. set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g")
  772. endif()
  773. endif()
  774. # y using special debug build of python
  775. if(Boost_USE_DEBUG_PYTHON)
  776. set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y")
  777. endif()
  778. # d using a debug version of your code
  779. set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d")
  780. # p using the STLport standard library rather than the
  781. # default one supplied with your compiler
  782. if(Boost_USE_STLPORT)
  783. set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p")
  784. set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p")
  785. endif()
  786. # n using the STLport deprecated "native iostreams" feature
  787. if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
  788. set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n")
  789. set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n")
  790. endif()
  791. if(Boost_DEBUG)
  792. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  793. "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
  794. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  795. "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
  796. endif()
  797. # ------------------------------------------------------------------------
  798. # Begin finding boost libraries
  799. # ------------------------------------------------------------------------
  800. if(BOOST_ROOT)
  801. set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
  802. ${BOOST_ROOT}/lib
  803. ${BOOST_ROOT}/stage/lib)
  804. endif()
  805. set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS
  806. ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}
  807. ${Boost_INCLUDE_DIR}/lib
  808. ${Boost_INCLUDE_DIR}/../lib
  809. ${Boost_INCLUDE_DIR}/stage/lib
  810. )
  811. set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM
  812. C:/boost/lib
  813. C:/boost
  814. "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
  815. "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}/lib"
  816. "$ENV{ProgramFiles}/boost/lib"
  817. "$ENV{ProgramFiles}/boost"
  818. /sw/local/lib
  819. )
  820. set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS})
  821. if( Boost_NO_SYSTEM_PATHS )
  822. set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH)
  823. else()
  824. list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM})
  825. endif()
  826. # prepend BOOST_LIBRARYDIR to search path if specified
  827. if( BOOST_LIBRARYDIR )
  828. file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
  829. set(_boost_LIBRARY_SEARCH_DIRS
  830. ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS})
  831. endif()
  832. if(Boost_DEBUG)
  833. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  834. "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}")
  835. endif()
  836. # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  837. if( Boost_USE_STATIC_LIBS )
  838. set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  839. if(WIN32)
  840. set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  841. else()
  842. set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
  843. endif()
  844. endif()
  845. # We want to use the tag inline below without risking double dashes
  846. if(_boost_RELEASE_ABI_TAG)
  847. if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
  848. set(_boost_RELEASE_ABI_TAG "")
  849. endif()
  850. endif()
  851. if(_boost_DEBUG_ABI_TAG)
  852. if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
  853. set(_boost_DEBUG_ABI_TAG "")
  854. endif()
  855. endif()
  856. # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
  857. # on WIN32 was to:
  858. # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
  859. # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
  860. # We maintain this behavior since changing it could break people's builds.
  861. # To disable the ambiguous behavior, the user need only
  862. # set Boost_USE_STATIC_RUNTIME either ON or OFF.
  863. set(_boost_STATIC_RUNTIME_WORKAROUND false)
  864. if(WIN32 AND Boost_USE_STATIC_LIBS)
  865. if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
  866. set(_boost_STATIC_RUNTIME_WORKAROUND true)
  867. endif()
  868. endif()
  869. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  870. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  871. set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
  872. set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
  873. set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
  874. set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
  875. set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
  876. #
  877. # Find RELEASE libraries
  878. #
  879. set(_boost_RELEASE_NAMES
  880. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
  881. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
  882. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
  883. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
  884. ${Boost_LIB_PREFIX}boost_${COMPONENT} )
  885. if(_boost_STATIC_RUNTIME_WORKAROUND)
  886. set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
  887. list(APPEND _boost_RELEASE_NAMES
  888. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
  889. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
  890. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
  891. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
  892. endif()
  893. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  894. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
  895. endif()
  896. if(Boost_DEBUG)
  897. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  898. "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
  899. endif()
  900. find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
  901. NAMES ${_boost_RELEASE_NAMES}
  902. HINTS ${_boost_LIBRARY_SEARCH_DIRS}
  903. ${_boost_FIND_OPTIONS}
  904. DOC "${_boost_docstring_release}"
  905. )
  906. #
  907. # Find DEBUG libraries
  908. #
  909. set(_boost_DEBUG_NAMES
  910. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
  911. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
  912. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
  913. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
  914. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
  915. ${Boost_LIB_PREFIX}boost_${COMPONENT} )
  916. if(_boost_STATIC_RUNTIME_WORKAROUND)
  917. set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
  918. list(APPEND _boost_DEBUG_NAMES
  919. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
  920. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
  921. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
  922. ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
  923. endif()
  924. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  925. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
  926. endif()
  927. if(Boost_DEBUG)
  928. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  929. "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
  930. endif()
  931. find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
  932. NAMES ${_boost_DEBUG_NAMES}
  933. HINTS ${_boost_LIBRARY_SEARCH_DIRS}
  934. ${_boost_FIND_OPTIONS}
  935. DOC "${_boost_docstring_debug}"
  936. )
  937. if(Boost_REALPATH)
  938. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
  939. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" )
  940. endif()
  941. _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
  942. endforeach(COMPONENT)
  943. # Restore the original find library ordering
  944. if( Boost_USE_STATIC_LIBS )
  945. set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  946. endif()
  947. # ------------------------------------------------------------------------
  948. # End finding boost libraries
  949. # ------------------------------------------------------------------------
  950. set(Boost_INCLUDE_DIRS
  951. ${Boost_INCLUDE_DIR}
  952. )
  953. set(Boost_FOUND FALSE)
  954. if(Boost_INCLUDE_DIR)
  955. set( Boost_FOUND TRUE )
  956. # Check the version of Boost against the requested version.
  957. if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  958. 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")
  959. endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  960. if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
  961. set( Boost_FOUND FALSE )
  962. set(_Boost_VERSION_AGE "old")
  963. elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  964. if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
  965. set( Boost_FOUND FALSE )
  966. set(_Boost_VERSION_AGE "old")
  967. elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  968. if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
  969. set( Boost_FOUND FALSE )
  970. set(_Boost_VERSION_AGE "old")
  971. endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
  972. endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
  973. endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
  974. if (NOT Boost_FOUND)
  975. _Boost_MARK_COMPONENTS_FOUND(OFF)
  976. endif()
  977. if (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
  978. # If the user requested an exact version of Boost, check
  979. # that. We already know that the Boost version we have is >= the
  980. # requested version.
  981. set(_Boost_VERSION_AGE "new")
  982. # If the user didn't specify a patchlevel, it's 0.
  983. if (NOT Boost_FIND_VERSION_PATCH)
  984. set(Boost_FIND_VERSION_PATCH 0)
  985. endif (NOT Boost_FIND_VERSION_PATCH)
  986. # We'll set Boost_FOUND true again if we have an exact version match.
  987. set(Boost_FOUND FALSE)
  988. _Boost_MARK_COMPONENTS_FOUND(OFF)
  989. if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  990. if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  991. if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
  992. set( Boost_FOUND TRUE )
  993. _Boost_MARK_COMPONENTS_FOUND(ON)
  994. endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
  995. endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
  996. endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
  997. endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
  998. if(NOT Boost_FOUND)
  999. # State that we found a version of Boost that is too new or too old.
  1000. set(Boost_ERROR_REASON
  1001. "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1002. if (Boost_FIND_VERSION_PATCH)
  1003. set(Boost_ERROR_REASON
  1004. "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
  1005. endif (Boost_FIND_VERSION_PATCH)
  1006. if (NOT Boost_FIND_VERSION_EXACT)
  1007. set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
  1008. endif (NOT Boost_FIND_VERSION_EXACT)
  1009. set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
  1010. endif (NOT Boost_FOUND)
  1011. # Always check for missing components
  1012. set(_boost_CHECKED_COMPONENT FALSE)
  1013. set(_Boost_MISSING_COMPONENTS "")
  1014. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1015. string(TOUPPER ${COMPONENT} COMPONENT)
  1016. set(_boost_CHECKED_COMPONENT TRUE)
  1017. if(NOT Boost_${COMPONENT}_FOUND)
  1018. string(TOLOWER ${COMPONENT} COMPONENT)
  1019. list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
  1020. set( Boost_FOUND FALSE)
  1021. endif()
  1022. endforeach(COMPONENT)
  1023. if(Boost_DEBUG)
  1024. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
  1025. endif()
  1026. if (_Boost_MISSING_COMPONENTS)
  1027. # We were unable to find some libraries, so generate a sensible
  1028. # error message that lists the libraries we were unable to find.
  1029. set(Boost_ERROR_REASON
  1030. "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n")
  1031. foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
  1032. set(Boost_ERROR_REASON
  1033. "${Boost_ERROR_REASON} boost_${COMPONENT}\n")
  1034. endforeach(COMPONENT)
  1035. list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
  1036. list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
  1037. if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  1038. set(Boost_ERROR_REASON
  1039. "${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.")
  1040. else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  1041. set(Boost_ERROR_REASON
  1042. "${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.")
  1043. endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  1044. endif (_Boost_MISSING_COMPONENTS)
  1045. if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
  1046. # Compatibility Code for backwards compatibility with CMake
  1047. # 2.4's FindBoost module.
  1048. # Look for the boost library path.
  1049. # Note that the user may not have installed any libraries
  1050. # so it is quite possible the Boost_LIBRARY_PATH may not exist.
  1051. set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
  1052. if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
  1053. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1054. endif()
  1055. if("${_boost_LIB_DIR}" MATCHES "/include$")
  1056. # Strip off the trailing "/include" in the path.
  1057. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1058. endif()
  1059. if(EXISTS "${_boost_LIB_DIR}/lib")
  1060. set(_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
  1061. else()
  1062. if(EXISTS "${_boost_LIB_DIR}/stage/lib")
  1063. set(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib)
  1064. else()
  1065. set(_boost_LIB_DIR "")
  1066. endif()
  1067. endif()
  1068. if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
  1069. set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
  1070. endif()
  1071. endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
  1072. else(Boost_INCLUDE_DIR)
  1073. set( Boost_FOUND FALSE)
  1074. endif(Boost_INCLUDE_DIR)
  1075. if(Boost_FOUND)
  1076. if(NOT Boost_FIND_QUIETLY)
  1077. message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  1078. if(Boost_FIND_COMPONENTS)
  1079. message(STATUS "Found the following Boost libraries:")
  1080. endif()
  1081. endif(NOT Boost_FIND_QUIETLY)
  1082. foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
  1083. string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
  1084. if( Boost_${UPPERCOMPONENT}_FOUND )
  1085. if(NOT Boost_FIND_QUIETLY)
  1086. message (STATUS " ${COMPONENT}")
  1087. endif(NOT Boost_FIND_QUIETLY)
  1088. set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
  1089. endif( Boost_${UPPERCOMPONENT}_FOUND )
  1090. endforeach(COMPONENT)
  1091. else()
  1092. if(Boost_FIND_REQUIRED)
  1093. message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
  1094. else()
  1095. if(NOT Boost_FIND_QUIETLY)
  1096. # we opt not to automatically output Boost_ERROR_REASON here as
  1097. # it could be quite lengthy and somewhat imposing in it's requests
  1098. # Since Boost is not always a required dependency we'll leave this
  1099. # up to the end-user.
  1100. if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG)
  1101. message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}")
  1102. else()
  1103. message(STATUS "Could NOT find Boost")
  1104. endif()
  1105. endif()
  1106. endif(Boost_FIND_REQUIRED)
  1107. endif()
  1108. # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
  1109. mark_as_advanced(Boost_INCLUDE_DIR
  1110. Boost_INCLUDE_DIRS
  1111. Boost_LIBRARY_DIRS
  1112. )
  1113. endif(_boost_IN_CACHE)