FindBoost.cmake 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindBoost
  5. ---------
  6. Find Boost include dirs and libraries
  7. Use this module by invoking find_package with the form::
  8. find_package(Boost
  9. [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
  10. [REQUIRED] # Fail with error if Boost is not found
  11. [COMPONENTS <libs>...] # Boost libraries by their canonical name
  12. # e.g. "date_time" for "libboost_date_time"
  13. [OPTIONAL_COMPONENTS <libs>...]
  14. # Optional Boost libraries by their canonical name)
  15. ) # e.g. "date_time" for "libboost_date_time"
  16. This module finds headers and requested component libraries OR a CMake
  17. package configuration file provided by a "Boost CMake" build. For the
  18. latter case skip to the "Boost CMake" section below. For the former
  19. case results are reported in variables::
  20. Boost_FOUND - True if headers and requested libraries were found
  21. Boost_INCLUDE_DIRS - Boost include directories
  22. Boost_LIBRARY_DIRS - Link directories for Boost libraries
  23. Boost_LIBRARIES - Boost component libraries to be linked
  24. Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
  25. Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
  26. target_link_libraries debug/optimized keywords)
  27. Boost_VERSION_MACRO - BOOST_VERSION value from boost/version.hpp
  28. Boost_VERSION_STRING - Boost version number in x.y.z format
  29. Boost_VERSION - if CMP0093 NEW => same as Boost_VERSION_STRING
  30. if CMP0093 OLD or unset => same as Boost_VERSION_MACRO
  31. Boost_LIB_VERSION - Version string appended to library filenames
  32. Boost_VERSION_MAJOR - Boost major version number (X in X.y.z)
  33. alias: Boost_MAJOR_VERSION
  34. Boost_VERSION_MINOR - Boost minor version number (Y in x.Y.z)
  35. alias: Boost_MINOR_VERSION
  36. Boost_VERSION_PATCH - Boost subminor version number (Z in x.y.Z)
  37. alias: Boost_SUBMINOR_VERSION
  38. Boost_VERSION_COUNT - Amount of version components (3)
  39. Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
  40. - Pass to add_definitions() to have diagnostic
  41. information about Boost's automatic linking
  42. displayed during compilation
  43. Note that Boost Python components require a Python version suffix
  44. (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
  45. versions built against Python 3.6 and 2.7, respectively. This also
  46. applies to additional components using Python including
  47. ``mpi_python`` and ``numpy``. Earlier Boost releases may use
  48. distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
  49. These may also be used as suffixes, but note that they are not
  50. portable.
  51. This module reads hints about search locations from variables::
  52. BOOST_ROOT - Preferred installation prefix
  53. (or BOOSTROOT)
  54. BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
  55. BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
  56. Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
  57. specified by these hint variables. Default is OFF.
  58. Boost_ADDITIONAL_VERSIONS
  59. - List of Boost versions not known to this module
  60. (Boost install locations may contain the version)
  61. and saves search results persistently in CMake cache entries::
  62. Boost_INCLUDE_DIR - Directory containing Boost headers
  63. Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
  64. Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
  65. Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
  66. Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
  67. The following :prop_tgt:`IMPORTED` targets are also defined::
  68. Boost::headers - Target for header-only dependencies
  69. (Boost include directory)
  70. alias: Boost::boost
  71. Boost::<C> - Target for specific component dependency
  72. (shared or static library); <C> is lower-
  73. case
  74. Boost::diagnostic_definitions - interface target to enable diagnostic
  75. information about Boost's automatic linking
  76. during compilation (adds BOOST_LIB_DIAGNOSTIC)
  77. Boost::disable_autolinking - interface target to disable automatic
  78. linking with MSVC (adds BOOST_ALL_NO_LIB)
  79. Boost::dynamic_linking - interface target to enable dynamic linking
  80. linking with MSVC (adds BOOST_ALL_DYN_LINK)
  81. Implicit dependencies such as ``Boost::filesystem`` requiring
  82. ``Boost::system`` will be automatically detected and satisfied, even
  83. if system is not specified when using :command:`find_package` and if
  84. ``Boost::system`` is not added to :command:`target_link_libraries`. If using
  85. ``Boost::thread``, then ``Threads::Threads`` will also be added automatically.
  86. It is important to note that the imported targets behave differently
  87. than variables created by this module: multiple calls to
  88. :command:`find_package(Boost)` in the same directory or sub-directories with
  89. different options (e.g. static or shared) will not override the
  90. values of the targets created by the first call.
  91. Users may set these hints or results as ``CACHE`` entries. Projects
  92. should not read these entries directly but instead use the above
  93. result variables. Note that some hint names start in upper-case
  94. "BOOST". One may specify these as environment variables if they are
  95. not specified as CMake variables or cache entries.
  96. This module first searches for the ``Boost`` header files using the above
  97. hint variables (excluding ``BOOST_LIBRARYDIR``) and saves the result in
  98. ``Boost_INCLUDE_DIR``. Then it searches for requested component libraries
  99. using the above hints (excluding ``BOOST_INCLUDEDIR`` and
  100. ``Boost_ADDITIONAL_VERSIONS``), "lib" directories near ``Boost_INCLUDE_DIR``,
  101. and the library name configuration settings below. It saves the
  102. library directories in ``Boost_LIBRARY_DIR_DEBUG`` and
  103. ``Boost_LIBRARY_DIR_RELEASE`` and individual library
  104. locations in ``Boost_<C>_LIBRARY_DEBUG`` and ``Boost_<C>_LIBRARY_RELEASE``.
  105. When one changes settings used by previous searches in the same build
  106. tree (excluding environment variables) this module discards previous
  107. search results affected by the changes and searches again.
  108. Boost libraries come in many variants encoded in their file name.
  109. Users or projects may tell this module which variant to find by
  110. setting variables::
  111. Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
  112. and use the debug libraries. Default is ON.
  113. Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
  114. and use the release libraries. Default is ON.
  115. Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
  116. libraries ('mt' tag). Default is ON.
  117. Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
  118. libraries. Default is OFF.
  119. Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
  120. libraries linked statically to the C++ runtime
  121. ('s' tag). Default is platform dependent.
  122. Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
  123. libraries linked to the MS debug C++ runtime
  124. ('g' tag). Default is ON.
  125. Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
  126. debug Python build ('y' tag). Default is OFF.
  127. Boost_USE_STLPORT - Set to ON to use libraries compiled with
  128. STLPort ('p' tag). Default is OFF.
  129. Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
  130. - Set to ON to use libraries compiled with
  131. STLPort deprecated "native iostreams"
  132. ('n' tag). Default is OFF.
  133. Boost_COMPILER - Set to the compiler-specific library suffix
  134. (e.g. "-gcc43"). Default is auto-computed
  135. for the C++ compiler in use. A list may be
  136. used if multiple compatible suffixes should
  137. be tested for, in decreasing order of
  138. preference.
  139. Boost_ARCHITECTURE - Set to the architecture-specific library suffix
  140. (e.g. "-x64"). Default is auto-computed for the
  141. C++ compiler in use.
  142. Boost_THREADAPI - Suffix for "thread" component library name,
  143. such as "pthread" or "win32". Names with
  144. and without this suffix will both be tried.
  145. Boost_NAMESPACE - Alternate namespace used to build boost with
  146. e.g. if set to "myboost", will search for
  147. myboost_thread instead of boost_thread.
  148. Other variables one may set to control this module are::
  149. Boost_DEBUG - Set to ON to enable debug output from FindBoost.
  150. Please enable this before filing any bug report.
  151. Boost_REALPATH - Set to ON to resolve symlinks for discovered
  152. libraries to assist with packaging. For example,
  153. the "system" component library may be resolved to
  154. "/usr/lib/libboost_system.so.1.67.0" instead of
  155. "/usr/lib/libboost_system.so". This does not
  156. affect linking and should not be enabled unless
  157. the user needs this information.
  158. Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
  159. Boost_LIBRARY_DIR_DEBUG.
  160. On Visual Studio and Borland compilers Boost headers request automatic
  161. linking to corresponding libraries. This requires matching libraries
  162. to be linked explicitly or available in the link library search path.
  163. In this case setting ``Boost_USE_STATIC_LIBS`` to ``OFF`` may not achieve
  164. dynamic linking. Boost automatic linking typically requests static
  165. libraries with a few exceptions (such as ``Boost.Python``). Use::
  166. add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
  167. to ask Boost to report information about automatic linking requests.
  168. Example to find Boost headers only::
  169. find_package(Boost 1.36.0)
  170. if(Boost_FOUND)
  171. include_directories(${Boost_INCLUDE_DIRS})
  172. add_executable(foo foo.cc)
  173. endif()
  174. Example to find Boost libraries and use imported targets::
  175. find_package(Boost 1.56 REQUIRED COMPONENTS
  176. date_time filesystem iostreams)
  177. add_executable(foo foo.cc)
  178. target_link_libraries(foo Boost::date_time Boost::filesystem
  179. Boost::iostreams)
  180. Example to find Boost Python 3.6 libraries and use imported targets::
  181. find_package(Boost 1.67 REQUIRED COMPONENTS
  182. python36 numpy36)
  183. add_executable(foo foo.cc)
  184. target_link_libraries(foo Boost::python36 Boost::numpy36)
  185. Example to find Boost headers and some *static* (release only) libraries::
  186. set(Boost_USE_STATIC_LIBS ON) # only find static libs
  187. set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
  188. set(Boost_USE_RELEASE_LIBS ON) # only find release libs
  189. set(Boost_USE_MULTITHREADED ON)
  190. set(Boost_USE_STATIC_RUNTIME OFF)
  191. find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
  192. if(Boost_FOUND)
  193. include_directories(${Boost_INCLUDE_DIRS})
  194. add_executable(foo foo.cc)
  195. target_link_libraries(foo ${Boost_LIBRARIES})
  196. endif()
  197. Boost CMake
  198. ^^^^^^^^^^^
  199. If Boost was built using the boost-cmake project or from Boost 1.70.0 on
  200. it provides a package configuration file for use with find_package's config mode.
  201. This module looks for the package configuration file called
  202. ``BoostConfig.cmake`` or ``boost-config.cmake`` and stores the result in
  203. ``CACHE`` entry "Boost_DIR". If found, the package configuration file is loaded
  204. and this module returns with no further action. See documentation of
  205. the Boost CMake package configuration for details on what it provides.
  206. Set ``Boost_NO_BOOST_CMAKE`` to ``ON``, to disable the search for boost-cmake.
  207. #]=======================================================================]
  208. # The FPHSA helper provides standard way of reporting final search results to
  209. # the user including the version and component checks.
  210. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  211. # Save project's policies
  212. cmake_policy(PUSH)
  213. cmake_policy(SET CMP0057 NEW) # if IN_LIST
  214. #-------------------------------------------------------------------------------
  215. # Before we go searching, check whether a boost cmake package is available, unless
  216. # the user specifically asked NOT to search for one.
  217. #
  218. # If Boost_DIR is set, this behaves as any find_package call would. If not,
  219. # it looks at BOOST_ROOT and BOOSTROOT to find Boost.
  220. #
  221. if (NOT Boost_NO_BOOST_CMAKE)
  222. # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives,
  223. # since these are more conventional for Boost.
  224. if ("$ENV{Boost_DIR}" STREQUAL "")
  225. if (NOT "$ENV{BOOST_ROOT}" STREQUAL "")
  226. set(ENV{Boost_DIR} $ENV{BOOST_ROOT})
  227. elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "")
  228. set(ENV{Boost_DIR} $ENV{BOOSTROOT})
  229. endif()
  230. endif()
  231. # Do the same find_package call but look specifically for the CMake version.
  232. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
  233. # need to delegate them to this find_package call.
  234. find_package(Boost QUIET NO_MODULE)
  235. mark_as_advanced(Boost_DIR)
  236. # If we found a boost cmake package, then we're done. Print out what we found.
  237. # Otherwise let the rest of the module try to find it.
  238. if(Boost_FOUND)
  239. # Neither the legacy boost-cmake nor the new builtin BoostConfig (as in 1.70)
  240. # report the found components in the standard variables, so we need to convert
  241. # them here
  242. if(Boost_FIND_COMPONENTS)
  243. foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
  244. string(TOUPPER ${_comp} _uppercomp)
  245. if(DEFINED Boost${_comp}_FOUND)
  246. set(Boost_${_comp}_FOUND ${Boost${_comp}_FOUND})
  247. elseif(DEFINED Boost_${_uppercomp}_FOUND)
  248. set(Boost_${_comp}_FOUND ${Boost_${_uppercomp}_FOUND})
  249. endif()
  250. endforeach()
  251. endif()
  252. find_package_handle_standard_args(Boost HANDLE_COMPONENTS CONFIG_MODE)
  253. # Restore project's policies
  254. cmake_policy(POP)
  255. return()
  256. endif()
  257. endif()
  258. #-------------------------------------------------------------------------------
  259. # FindBoost functions & macros
  260. #
  261. #
  262. # Print debug text if Boost_DEBUG is set.
  263. # Call example:
  264. # _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "debug message")
  265. #
  266. function(_Boost_DEBUG_PRINT file line text)
  267. if(Boost_DEBUG)
  268. message(STATUS "[ ${file}:${line} ] ${text}")
  269. endif()
  270. endfunction()
  271. #
  272. # _Boost_DEBUG_PRINT_VAR(file line variable_name [ENVIRONMENT]
  273. # [SOURCE "short explanation of origin of var value"])
  274. #
  275. # ENVIRONMENT - look up environment variable instead of CMake variable
  276. #
  277. # Print variable name and its value if Boost_DEBUG is set.
  278. # Call example:
  279. # _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" BOOST_ROOT)
  280. #
  281. function(_Boost_DEBUG_PRINT_VAR file line name)
  282. if(Boost_DEBUG)
  283. cmake_parse_arguments(_args "ENVIRONMENT" "SOURCE" "" ${ARGN})
  284. unset(source)
  285. if(_args_SOURCE)
  286. set(source " (${_args_SOURCE})")
  287. endif()
  288. if(_args_ENVIRONMENT)
  289. if(DEFINED ENV{${name}})
  290. set(value "\"$ENV{${name}}\"")
  291. else()
  292. set(value "<unset>")
  293. endif()
  294. set(_name "ENV{${name}}")
  295. else()
  296. if(DEFINED "${name}")
  297. set(value "\"${${name}}\"")
  298. else()
  299. set(value "<unset>")
  300. endif()
  301. set(_name "${name}")
  302. endif()
  303. _Boost_DEBUG_PRINT("${file}" "${line}" "${_name} = ${value}${source}")
  304. endif()
  305. endfunction()
  306. ############################################
  307. #
  308. # Check the existence of the libraries.
  309. #
  310. ############################################
  311. # This macro was taken directly from the FindQt4.cmake file that is included
  312. # with the CMake distribution. This is NOT my work. All work was done by the
  313. # original authors of the FindQt4.cmake file. Only minor modifications were
  314. # made to remove references to Qt and make this file more generally applicable
  315. # And ELSE/ENDIF pairs were removed for readability.
  316. #########################################################################
  317. macro(_Boost_ADJUST_LIB_VARS basename)
  318. if(Boost_INCLUDE_DIR )
  319. if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
  320. # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
  321. # single-config generators, set optimized and debug libraries
  322. get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
  323. if(_isMultiConfig OR CMAKE_BUILD_TYPE)
  324. set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  325. else()
  326. # For single-config generators where CMAKE_BUILD_TYPE has no value,
  327. # just use the release libraries
  328. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  329. endif()
  330. # FIXME: This probably should be set for both cases
  331. set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  332. endif()
  333. # if only the release version was found, set the debug variable also to the release version
  334. if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
  335. set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
  336. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
  337. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
  338. endif()
  339. # if only the debug version was found, set the release variable also to the debug version
  340. if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
  341. set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
  342. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
  343. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
  344. endif()
  345. # If the debug & release library ends up being the same, omit the keywords
  346. if("${Boost_${basename}_LIBRARY_RELEASE}" STREQUAL "${Boost_${basename}_LIBRARY_DEBUG}")
  347. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  348. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
  349. endif()
  350. if(Boost_${basename}_LIBRARY AND Boost_${basename}_HEADER)
  351. set(Boost_${basename}_FOUND ON)
  352. if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads)
  353. string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)")
  354. set(Boost_THREAD_FOUND OFF)
  355. endif()
  356. endif()
  357. endif()
  358. # Make variables changeable to the advanced user
  359. mark_as_advanced(
  360. Boost_${basename}_LIBRARY_RELEASE
  361. Boost_${basename}_LIBRARY_DEBUG
  362. )
  363. endmacro()
  364. # Detect changes in used variables.
  365. # Compares the current variable value with the last one.
  366. # In short form:
  367. # v != v_LAST -> CHANGED = 1
  368. # v is defined, v_LAST not -> CHANGED = 1
  369. # v is not defined, but v_LAST is -> CHANGED = 1
  370. # otherwise -> CHANGED = 0
  371. # CHANGED is returned in variable named ${changed_var}
  372. macro(_Boost_CHANGE_DETECT changed_var)
  373. set(${changed_var} 0)
  374. foreach(v ${ARGN})
  375. if(DEFINED _Boost_COMPONENTS_SEARCHED)
  376. if(${v})
  377. if(_${v}_LAST)
  378. string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED)
  379. else()
  380. set(_${v}_CHANGED 1)
  381. endif()
  382. elseif(_${v}_LAST)
  383. set(_${v}_CHANGED 1)
  384. endif()
  385. if(_${v}_CHANGED)
  386. set(${changed_var} 1)
  387. endif()
  388. else()
  389. set(_${v}_CHANGED 0)
  390. endif()
  391. endforeach()
  392. endmacro()
  393. #
  394. # Find the given library (var).
  395. # Use 'build_type' to support different lib paths for RELEASE or DEBUG builds
  396. #
  397. macro(_Boost_FIND_LIBRARY var build_type)
  398. find_library(${var} ${ARGN})
  399. if(${var})
  400. # If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
  401. if(NOT Boost_LIBRARY_DIR_${build_type})
  402. get_filename_component(_dir "${${var}}" PATH)
  403. set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE)
  404. endif()
  405. elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  406. # Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
  407. find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN})
  408. endif()
  409. # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there.
  410. if(Boost_LIBRARY_DIR_${build_type})
  411. set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  412. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  413. "Boost_LIBRARY_DIR_${build_type}")
  414. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  415. "_boost_LIBRARY_SEARCH_DIRS_${build_type}")
  416. endif()
  417. endmacro()
  418. #-------------------------------------------------------------------------------
  419. # Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
  420. function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
  421. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
  422. _boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
  423. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
  424. _boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
  425. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
  426. set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
  427. set(${_OUTPUT_VERSION_MAJOR} ${_boost_COMPILER_VERSION_MAJOR} PARENT_SCOPE)
  428. set(${_OUTPUT_VERSION_MINOR} ${_boost_COMPILER_VERSION_MINOR} PARENT_SCOPE)
  429. endfunction()
  430. #
  431. # Take a list of libraries with "thread" in it
  432. # and prepend duplicates with "thread_${Boost_THREADAPI}"
  433. # at the front of the list
  434. #
  435. function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
  436. set(_orig_libnames ${ARGN})
  437. string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}")
  438. set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
  439. endfunction()
  440. #
  441. # If a library is found, replace its cache entry with its REALPATH
  442. #
  443. function(_Boost_SWAP_WITH_REALPATH _library _docstring)
  444. if(${_library})
  445. get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
  446. unset(${_library} CACHE)
  447. set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
  448. endif()
  449. endfunction()
  450. function(_Boost_CHECK_SPELLING _var)
  451. if(${_var})
  452. string(TOUPPER ${_var} _var_UC)
  453. message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.")
  454. endif()
  455. endfunction()
  456. # Guesses Boost's compiler prefix used in built library names
  457. # Returns the guess by setting the variable pointed to by _ret
  458. function(_Boost_GUESS_COMPILER_PREFIX _ret)
  459. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
  460. if(WIN32)
  461. set (_boost_COMPILER "-iw")
  462. else()
  463. set (_boost_COMPILER "-il")
  464. endif()
  465. elseif (GHSMULTI)
  466. set(_boost_COMPILER "-ghs")
  467. elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
  468. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
  469. # Not yet known.
  470. set(_boost_COMPILER "")
  471. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
  472. # MSVC toolset 14.x versions are forward compatible.
  473. set(_boost_COMPILER "")
  474. foreach(v 9 8 7 6 5 4 3 2 1 0)
  475. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
  476. list(APPEND _boost_COMPILER "-vc14${v}")
  477. endif()
  478. endforeach()
  479. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
  480. set(_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION}")
  481. elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
  482. set(_boost_COMPILER "-vc71")
  483. elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
  484. set(_boost_COMPILER "-vc7") # yes, this is correct
  485. else() # VS 6.0 Good luck!
  486. set(_boost_COMPILER "-vc6") # yes, this is correct
  487. endif()
  488. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
  489. string(REPLACE "." ";" VERSION_LIST "${CMAKE_CXX_COMPILER_VERSION}")
  490. list(GET VERSION_LIST 0 CLANG_VERSION_MAJOR)
  491. set(_boost_COMPILER "-clangw${CLANG_VERSION_MAJOR};${_boost_COMPILER}")
  492. endif()
  493. elseif (BORLAND)
  494. set(_boost_COMPILER "-bcb")
  495. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
  496. set(_boost_COMPILER "-sw")
  497. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
  498. set(_boost_COMPILER "-xlc")
  499. elseif (MINGW)
  500. if(Boost_VERSION_STRING VERSION_LESS 1.34)
  501. set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
  502. else()
  503. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
  504. set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
  505. endif()
  506. elseif (UNIX)
  507. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
  508. if(NOT Boost_VERSION_STRING VERSION_LESS 1.69.0)
  509. # From GCC 5 and clang 4, versioning changes and minor becomes patch.
  510. # For those compilers, patch is exclude from compiler tag in Boost 1.69+ library naming.
  511. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 4)
  512. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
  513. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 3)
  514. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
  515. endif()
  516. endif()
  517. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  518. if(Boost_VERSION_STRING VERSION_LESS 1.34)
  519. set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
  520. else()
  521. # Determine which version of GCC we have.
  522. if(APPLE)
  523. if(Boost_VERSION_STRING VERSION_LESS 1.36.0)
  524. # In Boost <= 1.35.0, there is no mangled compiler name for
  525. # the macOS/Darwin version of GCC.
  526. set(_boost_COMPILER "")
  527. else()
  528. # In Boost 1.36.0 and newer, the mangled compiler name used
  529. # on macOS/Darwin is "xgcc".
  530. set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
  531. endif()
  532. else()
  533. set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
  534. endif()
  535. endif()
  536. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  537. # TODO: Find out any Boost version constraints vs clang support.
  538. set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")
  539. endif()
  540. else()
  541. set(_boost_COMPILER "")
  542. endif()
  543. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  544. "_boost_COMPILER" SOURCE "guessed")
  545. set(${_ret} ${_boost_COMPILER} PARENT_SCOPE)
  546. endfunction()
  547. #
  548. # Get component dependencies. Requires the dependencies to have been
  549. # defined for the Boost release version.
  550. #
  551. # component - the component to check
  552. # _ret - list of library dependencies
  553. #
  554. function(_Boost_COMPONENT_DEPENDENCIES component _ret)
  555. # Note: to add a new Boost release, run
  556. #
  557. # % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
  558. #
  559. # The output may be added in a new block below. If it's the same as
  560. # the previous release, simply update the version range of the block
  561. # for the previous release. Also check if any new components have
  562. # been added, and add any new components to
  563. # _Boost_COMPONENT_HEADERS.
  564. #
  565. # This information was originally generated by running
  566. # BoostScanDeps.cmake against every boost release to date supported
  567. # by FindBoost:
  568. #
  569. # % for version in /path/to/boost/sources/*
  570. # do
  571. # cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
  572. # done
  573. #
  574. # The output was then updated by search and replace with these regexes:
  575. #
  576. # - Strip message(STATUS) prefix dashes
  577. # s;^-- ;;
  578. # - Indent
  579. # s;^set(; set(;;
  580. # - Add conditionals
  581. # s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION_STRING VERSION_LESS \1\.\2\.\3 AND Boost_VERSION_STRING VERSION_LESS xxxx);
  582. #
  583. # This results in the logic seen below, but will require the xxxx
  584. # replacing with the following Boost release version (or the next
  585. # minor version to be released, e.g. 1.59 was the latest at the time
  586. # of writing, making 1.60 the next. Identical consecutive releases
  587. # were then merged together by updating the end range of the first
  588. # block and removing the following redundant blocks.
  589. #
  590. # Running the script against all historical releases should be
  591. # required only if the BoostScanDeps.cmake script logic is changed.
  592. # The addition of a new release should only require it to be run
  593. # against the new release.
  594. # Handle Python version suffixes
  595. if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
  596. set(component "${CMAKE_MATCH_1}")
  597. set(component_python_version "${CMAKE_MATCH_2}")
  598. endif()
  599. set(_Boost_IMPORTED_TARGETS TRUE)
  600. if(Boost_VERSION_STRING AND Boost_VERSION_STRING VERSION_LESS 1.33.0)
  601. message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION_STRING} (all versions older than 1.33)")
  602. set(_Boost_IMPORTED_TARGETS FALSE)
  603. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.33.0 AND Boost_VERSION_STRING VERSION_LESS 1.35.0)
  604. set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
  605. set(_Boost_REGEX_DEPENDENCIES thread)
  606. set(_Boost_WAVE_DEPENDENCIES filesystem thread)
  607. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  608. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.35.0 AND Boost_VERSION_STRING VERSION_LESS 1.36.0)
  609. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  610. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  611. set(_Boost_MPI_DEPENDENCIES serialization)
  612. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  613. set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
  614. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  615. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.36.0 AND Boost_VERSION_STRING VERSION_LESS 1.38.0)
  616. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  617. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  618. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
  619. set(_Boost_MPI_DEPENDENCIES serialization)
  620. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  621. set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
  622. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  623. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.38.0 AND Boost_VERSION_STRING VERSION_LESS 1.43.0)
  624. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  625. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  626. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
  627. set(_Boost_MPI_DEPENDENCIES serialization)
  628. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  629. set(_Boost_THREAD_DEPENDENCIES date_time)
  630. set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
  631. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  632. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.43.0 AND Boost_VERSION_STRING VERSION_LESS 1.44.0)
  633. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  634. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  635. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  636. set(_Boost_MPI_DEPENDENCIES serialization)
  637. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  638. set(_Boost_THREAD_DEPENDENCIES date_time)
  639. set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
  640. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  641. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.44.0 AND Boost_VERSION_STRING VERSION_LESS 1.45.0)
  642. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  643. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  644. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
  645. set(_Boost_MPI_DEPENDENCIES serialization)
  646. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  647. set(_Boost_THREAD_DEPENDENCIES date_time)
  648. set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
  649. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  650. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.45.0 AND Boost_VERSION_STRING VERSION_LESS 1.47.0)
  651. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  652. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  653. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  654. set(_Boost_MPI_DEPENDENCIES serialization)
  655. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  656. set(_Boost_THREAD_DEPENDENCIES date_time)
  657. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  658. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  659. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.47.0 AND Boost_VERSION_STRING VERSION_LESS 1.48.0)
  660. set(_Boost_CHRONO_DEPENDENCIES system)
  661. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  662. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  663. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  664. set(_Boost_MPI_DEPENDENCIES serialization)
  665. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  666. set(_Boost_THREAD_DEPENDENCIES date_time)
  667. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  668. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  669. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.48.0 AND Boost_VERSION_STRING VERSION_LESS 1.50.0)
  670. set(_Boost_CHRONO_DEPENDENCIES system)
  671. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  672. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  673. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  674. set(_Boost_MPI_DEPENDENCIES serialization)
  675. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  676. set(_Boost_THREAD_DEPENDENCIES date_time)
  677. set(_Boost_TIMER_DEPENDENCIES chrono system)
  678. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  679. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  680. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.50.0 AND Boost_VERSION_STRING VERSION_LESS 1.53.0)
  681. set(_Boost_CHRONO_DEPENDENCIES system)
  682. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  683. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  684. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  685. set(_Boost_MPI_DEPENDENCIES serialization)
  686. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  687. set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
  688. set(_Boost_TIMER_DEPENDENCIES chrono system)
  689. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
  690. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  691. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.53.0 AND Boost_VERSION_STRING VERSION_LESS 1.54.0)
  692. set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
  693. set(_Boost_CHRONO_DEPENDENCIES system)
  694. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  695. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  696. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  697. set(_Boost_MPI_DEPENDENCIES serialization)
  698. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  699. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  700. set(_Boost_TIMER_DEPENDENCIES chrono system)
  701. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
  702. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  703. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.54.0 AND Boost_VERSION_STRING VERSION_LESS 1.55.0)
  704. set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
  705. set(_Boost_CHRONO_DEPENDENCIES system)
  706. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  707. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  708. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  709. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  710. set(_Boost_MPI_DEPENDENCIES serialization)
  711. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  712. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  713. set(_Boost_TIMER_DEPENDENCIES chrono system)
  714. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  715. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  716. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.55.0 AND Boost_VERSION_STRING VERSION_LESS 1.56.0)
  717. set(_Boost_CHRONO_DEPENDENCIES system)
  718. set(_Boost_COROUTINE_DEPENDENCIES context system)
  719. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  720. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  721. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  722. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  723. set(_Boost_MPI_DEPENDENCIES serialization)
  724. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  725. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  726. set(_Boost_TIMER_DEPENDENCIES chrono system)
  727. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  728. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  729. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.56.0 AND Boost_VERSION_STRING VERSION_LESS 1.59.0)
  730. set(_Boost_CHRONO_DEPENDENCIES system)
  731. set(_Boost_COROUTINE_DEPENDENCIES context system)
  732. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  733. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  734. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  735. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  736. set(_Boost_MPI_DEPENDENCIES serialization)
  737. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  738. set(_Boost_RANDOM_DEPENDENCIES system)
  739. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  740. set(_Boost_TIMER_DEPENDENCIES chrono system)
  741. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  742. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  743. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.59.0 AND Boost_VERSION_STRING VERSION_LESS 1.60.0)
  744. set(_Boost_CHRONO_DEPENDENCIES system)
  745. set(_Boost_COROUTINE_DEPENDENCIES context system)
  746. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  747. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  748. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
  749. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  750. set(_Boost_MPI_DEPENDENCIES serialization)
  751. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  752. set(_Boost_RANDOM_DEPENDENCIES system)
  753. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  754. set(_Boost_TIMER_DEPENDENCIES chrono system)
  755. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  756. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  757. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.60.0 AND Boost_VERSION_STRING VERSION_LESS 1.61.0)
  758. set(_Boost_CHRONO_DEPENDENCIES system)
  759. set(_Boost_COROUTINE_DEPENDENCIES context system)
  760. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  761. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  762. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  763. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  764. set(_Boost_MPI_DEPENDENCIES serialization)
  765. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  766. set(_Boost_RANDOM_DEPENDENCIES system)
  767. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  768. set(_Boost_TIMER_DEPENDENCIES chrono system)
  769. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  770. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  771. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.61.0 AND Boost_VERSION_STRING VERSION_LESS 1.62.0)
  772. set(_Boost_CHRONO_DEPENDENCIES system)
  773. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  774. set(_Boost_COROUTINE_DEPENDENCIES context system)
  775. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  776. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  777. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  778. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  779. set(_Boost_MPI_DEPENDENCIES serialization)
  780. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  781. set(_Boost_RANDOM_DEPENDENCIES system)
  782. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  783. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  784. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  785. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.62.0 AND Boost_VERSION_STRING VERSION_LESS 1.63.0)
  786. set(_Boost_CHRONO_DEPENDENCIES system)
  787. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  788. set(_Boost_COROUTINE_DEPENDENCIES context system)
  789. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  790. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  791. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  792. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  793. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  794. set(_Boost_MPI_DEPENDENCIES serialization)
  795. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  796. set(_Boost_RANDOM_DEPENDENCIES system)
  797. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  798. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  799. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  800. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.63.0 AND Boost_VERSION_STRING VERSION_LESS 1.65.0)
  801. set(_Boost_CHRONO_DEPENDENCIES system)
  802. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  803. set(_Boost_COROUTINE_DEPENDENCIES context system)
  804. set(_Boost_COROUTINE2_DEPENDENCIES context fiber thread chrono system date_time)
  805. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  806. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  807. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  808. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  809. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  810. set(_Boost_MPI_DEPENDENCIES serialization)
  811. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  812. set(_Boost_RANDOM_DEPENDENCIES system)
  813. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  814. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  815. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  816. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.65.0 AND Boost_VERSION_STRING VERSION_LESS 1.67.0)
  817. set(_Boost_CHRONO_DEPENDENCIES system)
  818. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  819. set(_Boost_COROUTINE_DEPENDENCIES context system)
  820. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  821. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  822. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  823. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  824. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  825. set(_Boost_MPI_DEPENDENCIES serialization)
  826. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  827. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  828. set(_Boost_RANDOM_DEPENDENCIES system)
  829. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  830. set(_Boost_TIMER_DEPENDENCIES chrono system)
  831. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  832. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  833. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.67.0 AND Boost_VERSION_STRING VERSION_LESS 1.68.0)
  834. set(_Boost_CHRONO_DEPENDENCIES system)
  835. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  836. set(_Boost_COROUTINE_DEPENDENCIES context system)
  837. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  838. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  839. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  840. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  841. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  842. set(_Boost_MPI_DEPENDENCIES serialization)
  843. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  844. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  845. set(_Boost_RANDOM_DEPENDENCIES system)
  846. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  847. set(_Boost_TIMER_DEPENDENCIES chrono system)
  848. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  849. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  850. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.68.0 AND Boost_VERSION_STRING VERSION_LESS 1.69.0)
  851. set(_Boost_CHRONO_DEPENDENCIES system)
  852. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  853. set(_Boost_CONTRACT_DEPENDENCIES thread chrono system date_time)
  854. set(_Boost_COROUTINE_DEPENDENCIES context system)
  855. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  856. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  857. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  858. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  859. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  860. set(_Boost_MPI_DEPENDENCIES serialization)
  861. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  862. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  863. set(_Boost_RANDOM_DEPENDENCIES system)
  864. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  865. set(_Boost_TIMER_DEPENDENCIES chrono system)
  866. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  867. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  868. elseif(NOT Boost_VERSION_STRING VERSION_LESS 1.69.0 AND Boost_VERSION_STRING VERSION_LESS 1.70.0)
  869. set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
  870. set(_Boost_COROUTINE_DEPENDENCIES context)
  871. set(_Boost_FIBER_DEPENDENCIES context)
  872. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  873. set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
  874. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  875. set(_Boost_MPI_DEPENDENCIES serialization)
  876. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  877. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  878. set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
  879. set(_Boost_TIMER_DEPENDENCIES chrono system)
  880. set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
  881. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  882. else()
  883. if(NOT Boost_VERSION_STRING VERSION_LESS 1.70.0)
  884. set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
  885. set(_Boost_COROUTINE_DEPENDENCIES context)
  886. set(_Boost_FIBER_DEPENDENCIES context)
  887. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  888. set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
  889. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  890. set(_Boost_MPI_DEPENDENCIES serialization)
  891. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  892. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  893. set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
  894. set(_Boost_TIMER_DEPENDENCIES chrono system)
  895. set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
  896. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  897. endif()
  898. if(NOT Boost_VERSION_STRING VERSION_LESS 1.71.0)
  899. message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
  900. endif()
  901. endif()
  902. string(TOUPPER ${component} uppercomponent)
  903. set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  904. set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
  905. string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
  906. if (NOT _boost_DEPS_STRING)
  907. set(_boost_DEPS_STRING "(none)")
  908. endif()
  909. # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
  910. endfunction()
  911. #
  912. # Get component headers. This is the primary header (or headers) for
  913. # a given component, and is used to check that the headers are present
  914. # as well as the library itself as an extra sanity check of the build
  915. # environment.
  916. #
  917. # component - the component to check
  918. # _hdrs
  919. #
  920. function(_Boost_COMPONENT_HEADERS component _hdrs)
  921. # Handle Python version suffixes
  922. if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
  923. set(component "${CMAKE_MATCH_1}")
  924. set(component_python_version "${CMAKE_MATCH_2}")
  925. endif()
  926. # Note: new boost components will require adding here. The header
  927. # must be present in all versions of Boost providing a library.
  928. set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
  929. set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
  930. set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
  931. set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
  932. if(Boost_VERSION_STRING VERSION_LESS 1.61.0)
  933. set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
  934. else()
  935. set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
  936. endif()
  937. set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
  938. set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
  939. set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
  940. set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
  941. set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
  942. set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
  943. set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
  944. set(_Boost_IOSTREAMS_HEADERS "boost/iostreams/stream.hpp")
  945. set(_Boost_LOCALE_HEADERS "boost/locale.hpp")
  946. set(_Boost_LOG_HEADERS "boost/log/core.hpp")
  947. set(_Boost_LOG_SETUP_HEADERS "boost/log/detail/setup_config.hpp")
  948. set(_Boost_MATH_HEADERS "boost/math_fwd.hpp")
  949. set(_Boost_MATH_C99_HEADERS "boost/math/tr1.hpp")
  950. set(_Boost_MATH_C99F_HEADERS "boost/math/tr1.hpp")
  951. set(_Boost_MATH_C99L_HEADERS "boost/math/tr1.hpp")
  952. set(_Boost_MATH_TR1_HEADERS "boost/math/tr1.hpp")
  953. set(_Boost_MATH_TR1F_HEADERS "boost/math/tr1.hpp")
  954. set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
  955. set(_Boost_MPI_HEADERS "boost/mpi.hpp")
  956. set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
  957. set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp")
  958. set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
  959. set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
  960. set(_Boost_PYTHON_HEADERS "boost/python.hpp")
  961. set(_Boost_RANDOM_HEADERS "boost/random.hpp")
  962. set(_Boost_REGEX_HEADERS "boost/regex.hpp")
  963. set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
  964. set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
  965. set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
  966. set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
  967. set(_Boost_STACKTRACE_BASIC_HEADERS "boost/stacktrace.hpp")
  968. set(_Boost_STACKTRACE_NOOP_HEADERS "boost/stacktrace.hpp")
  969. set(_Boost_STACKTRACE_WINDBG_CACHED_HEADERS "boost/stacktrace.hpp")
  970. set(_Boost_STACKTRACE_WINDBG_HEADERS "boost/stacktrace.hpp")
  971. set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
  972. set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
  973. set(_Boost_THREAD_HEADERS "boost/thread.hpp")
  974. set(_Boost_TIMER_HEADERS "boost/timer.hpp")
  975. set(_Boost_TYPE_ERASURE_HEADERS "boost/type_erasure/config.hpp")
  976. set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
  977. set(_Boost_WAVE_HEADERS "boost/wave.hpp")
  978. set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
  979. if(WIN32)
  980. set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
  981. set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
  982. endif()
  983. string(TOUPPER ${component} uppercomponent)
  984. set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
  985. string(REGEX REPLACE ";" " " _boost_HDRS_STRING "${_Boost_${uppercomponent}_HEADERS}")
  986. if (NOT _boost_HDRS_STRING)
  987. set(_boost_HDRS_STRING "(none)")
  988. endif()
  989. # message(STATUS "Headers for Boost::${component}: ${_boost_HDRS_STRING}")
  990. endfunction()
  991. #
  992. # Determine if any missing dependencies require adding to the component list.
  993. #
  994. # Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
  995. # plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
  996. # defined; FALSE if dependency information is unavailable).
  997. #
  998. # componentvar - the component list variable name
  999. # extravar - the indirect dependency list variable name
  1000. #
  1001. #
  1002. function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
  1003. # _boost_unprocessed_components - list of components requiring processing
  1004. # _boost_processed_components - components already processed (or currently being processed)
  1005. # _boost_new_components - new components discovered for future processing
  1006. #
  1007. list(APPEND _boost_unprocessed_components ${${componentvar}})
  1008. while(_boost_unprocessed_components)
  1009. list(APPEND _boost_processed_components ${_boost_unprocessed_components})
  1010. foreach(component ${_boost_unprocessed_components})
  1011. string(TOUPPER ${component} uppercomponent)
  1012. set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  1013. _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
  1014. set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  1015. set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
  1016. foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
  1017. if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components))
  1018. list(APPEND _boost_new_components ${componentdep})
  1019. endif()
  1020. endforeach()
  1021. endforeach()
  1022. set(_boost_unprocessed_components ${_boost_new_components})
  1023. unset(_boost_new_components)
  1024. endwhile()
  1025. set(_boost_extra_components ${_boost_processed_components})
  1026. if(_boost_extra_components AND ${componentvar})
  1027. list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
  1028. endif()
  1029. set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
  1030. set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
  1031. endfunction()
  1032. #
  1033. # Some boost libraries may require particular set of compler features.
  1034. # The very first one was `boost::fiber` introduced in Boost 1.62.
  1035. # One can check required compiler features of it in
  1036. # - `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`;
  1037. # - `${Boost_ROOT}/libs/context/build/Jamfile.v2`.
  1038. #
  1039. # TODO (Re)Check compiler features on (every?) release ???
  1040. # One may use the following command to get the files to check:
  1041. #
  1042. # $ find . -name Jamfile.v2 | grep build | xargs grep -l cxx1
  1043. #
  1044. function(_Boost_COMPILER_FEATURES component _ret)
  1045. # Boost >= 1.62
  1046. if(NOT Boost_VERSION_STRING VERSION_LESS 1.62.0)
  1047. set(_Boost_FIBER_COMPILER_FEATURES
  1048. cxx_alias_templates
  1049. cxx_auto_type
  1050. cxx_constexpr
  1051. cxx_defaulted_functions
  1052. cxx_final
  1053. cxx_lambdas
  1054. cxx_noexcept
  1055. cxx_nullptr
  1056. cxx_rvalue_references
  1057. cxx_thread_local
  1058. cxx_variadic_templates
  1059. )
  1060. # Compiler feature for `context` same as for `fiber`.
  1061. set(_Boost_CONTEXT_COMPILER_FEATURES ${_Boost_FIBER_COMPILER_FEATURES})
  1062. endif()
  1063. # Boost Contract library available in >= 1.67
  1064. if(NOT Boost_VERSION_STRING VERSION_LESS 1.67.0)
  1065. # From `libs/contract/build/boost_contract_build.jam`
  1066. set(_Boost_CONTRACT_COMPILER_FEATURES
  1067. cxx_lambdas
  1068. cxx_variadic_templates
  1069. )
  1070. endif()
  1071. string(TOUPPER ${component} uppercomponent)
  1072. set(${_ret} ${_Boost_${uppercomponent}_COMPILER_FEATURES} PARENT_SCOPE)
  1073. endfunction()
  1074. #
  1075. # Update library search directory hint variable with paths used by prebuilt boost binaries.
  1076. #
  1077. # Prebuilt windows binaries (https://sourceforge.net/projects/boost/files/boost-binaries/)
  1078. # have library directories named using MSVC compiler version and architecture.
  1079. # This function would append corresponding directories if MSVC is a current compiler,
  1080. # so having `BOOST_ROOT` would be enough to specify to find everything.
  1081. #
  1082. function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
  1083. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
  1084. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  1085. set(_arch_suffix 64)
  1086. else()
  1087. set(_arch_suffix 32)
  1088. endif()
  1089. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
  1090. # Not yet known.
  1091. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
  1092. # MSVC toolset 14.x versions are forward compatible.
  1093. foreach(v 9 8 7 6 5 4 3 2 1 0)
  1094. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
  1095. list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.${v})
  1096. endif()
  1097. endforeach()
  1098. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
  1099. math(EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10")
  1100. list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-${_toolset_major_version}.0)
  1101. endif()
  1102. set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
  1103. endif()
  1104. endfunction()
  1105. #
  1106. # End functions/macros
  1107. #
  1108. #-------------------------------------------------------------------------------
  1109. #-------------------------------------------------------------------------------
  1110. # main.
  1111. #-------------------------------------------------------------------------------
  1112. # If the user sets Boost_LIBRARY_DIR, use it as the default for both
  1113. # configurations.
  1114. if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR)
  1115. set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}")
  1116. endif()
  1117. if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR)
  1118. set(Boost_LIBRARY_DIR_DEBUG "${Boost_LIBRARY_DIR}")
  1119. endif()
  1120. if(NOT DEFINED Boost_USE_DEBUG_LIBS)
  1121. set(Boost_USE_DEBUG_LIBS TRUE)
  1122. endif()
  1123. if(NOT DEFINED Boost_USE_RELEASE_LIBS)
  1124. set(Boost_USE_RELEASE_LIBS TRUE)
  1125. endif()
  1126. if(NOT DEFINED Boost_USE_MULTITHREADED)
  1127. set(Boost_USE_MULTITHREADED TRUE)
  1128. endif()
  1129. if(NOT DEFINED Boost_USE_DEBUG_RUNTIME)
  1130. set(Boost_USE_DEBUG_RUNTIME TRUE)
  1131. endif()
  1132. # Check the version of Boost against the requested version.
  1133. if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  1134. 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")
  1135. endif()
  1136. if(Boost_FIND_VERSION_EXACT)
  1137. # The version may appear in a directory with or without the patch
  1138. # level, even when the patch level is non-zero.
  1139. set(_boost_TEST_VERSIONS
  1140. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
  1141. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1142. else()
  1143. # The user has not requested an exact version. Among known
  1144. # versions, find those that are acceptable to the user request.
  1145. #
  1146. # Note: When adding a new Boost release, also update the dependency
  1147. # information in _Boost_COMPONENT_DEPENDENCIES and
  1148. # _Boost_COMPONENT_HEADERS. See the instructions at the top of
  1149. # _Boost_COMPONENT_DEPENDENCIES.
  1150. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
  1151. "1.70.0" "1.70" "1.69.0" "1.69"
  1152. "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
  1153. "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
  1154. "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
  1155. "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
  1156. "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
  1157. "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"
  1158. "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"
  1159. "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
  1160. "1.34" "1.33.1" "1.33.0" "1.33")
  1161. set(_boost_TEST_VERSIONS)
  1162. if(Boost_FIND_VERSION)
  1163. set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1164. # Select acceptable versions.
  1165. foreach(version ${_Boost_KNOWN_VERSIONS})
  1166. if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
  1167. # This version is high enough.
  1168. list(APPEND _boost_TEST_VERSIONS "${version}")
  1169. elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
  1170. # This version is a short-form for the requested version with
  1171. # the patch level dropped.
  1172. list(APPEND _boost_TEST_VERSIONS "${version}")
  1173. endif()
  1174. endforeach()
  1175. else()
  1176. # Any version is acceptable.
  1177. set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
  1178. endif()
  1179. endif()
  1180. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_TEST_VERSIONS")
  1181. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_MULTITHREADED")
  1182. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_STATIC_LIBS")
  1183. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_STATIC_RUNTIME")
  1184. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_ADDITIONAL_VERSIONS")
  1185. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_NO_SYSTEM_PATHS")
  1186. # Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
  1187. # will only contain any interface definitions on WIN32, but is created
  1188. # on all platforms to keep end user code free from platform dependent
  1189. # code. Also provide convenience targets to disable autolinking and
  1190. # enable dynamic linking.
  1191. if(NOT TARGET Boost::diagnostic_definitions)
  1192. add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
  1193. add_library(Boost::disable_autolinking INTERFACE IMPORTED)
  1194. add_library(Boost::dynamic_linking INTERFACE IMPORTED)
  1195. set_target_properties(Boost::dynamic_linking PROPERTIES
  1196. INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
  1197. endif()
  1198. if(WIN32)
  1199. # In windows, automatic linking is performed, so you do not have
  1200. # to specify the libraries. If you are linking to a dynamic
  1201. # runtime, then you can choose to link to either a static or a
  1202. # dynamic Boost library, the default is to do a static link. You
  1203. # can alter this for a specific library "whatever" by defining
  1204. # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
  1205. # linked dynamically. Alternatively you can force all Boost
  1206. # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
  1207. # This feature can be disabled for Boost library "whatever" by
  1208. # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
  1209. # BOOST_ALL_NO_LIB.
  1210. # If you want to observe which libraries are being linked against
  1211. # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
  1212. # code to emit a #pragma message each time a library is selected
  1213. # for linking.
  1214. set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
  1215. set_target_properties(Boost::diagnostic_definitions PROPERTIES
  1216. INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
  1217. set_target_properties(Boost::disable_autolinking PROPERTIES
  1218. INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
  1219. endif()
  1220. cmake_policy(GET CMP0074 _Boost_CMP0074)
  1221. if(NOT "x${_Boost_CMP0074}x" STREQUAL "xNEWx")
  1222. _Boost_CHECK_SPELLING(Boost_ROOT)
  1223. endif()
  1224. unset(_Boost_CMP0074)
  1225. _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
  1226. _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
  1227. # Collect environment variable inputs as hints. Do not consider changes.
  1228. foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR)
  1229. set(_env $ENV{${v}})
  1230. if(_env)
  1231. file(TO_CMAKE_PATH "${_env}" _ENV_${v})
  1232. else()
  1233. set(_ENV_${v} "")
  1234. endif()
  1235. endforeach()
  1236. if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT)
  1237. set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}")
  1238. endif()
  1239. # Collect inputs and cached results. Detect changes since the last run.
  1240. if(NOT BOOST_ROOT AND BOOSTROOT)
  1241. set(BOOST_ROOT "${BOOSTROOT}")
  1242. endif()
  1243. set(_Boost_VARS_DIR
  1244. BOOST_ROOT
  1245. Boost_NO_SYSTEM_PATHS
  1246. )
  1247. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_ROOT")
  1248. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_ROOT" ENVIRONMENT)
  1249. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_INCLUDEDIR")
  1250. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_INCLUDEDIR" ENVIRONMENT)
  1251. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_LIBRARYDIR")
  1252. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_LIBRARYDIR" ENVIRONMENT)
  1253. # ------------------------------------------------------------------------
  1254. # Search for Boost include DIR
  1255. # ------------------------------------------------------------------------
  1256. set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS)
  1257. _Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC})
  1258. # Clear Boost_INCLUDE_DIR if it did not change but other input affecting the
  1259. # location did. We will find a new one based on the new inputs.
  1260. if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED)
  1261. unset(Boost_INCLUDE_DIR CACHE)
  1262. endif()
  1263. if(NOT Boost_INCLUDE_DIR)
  1264. set(_boost_INCLUDE_SEARCH_DIRS "")
  1265. if(BOOST_INCLUDEDIR)
  1266. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR})
  1267. elseif(_ENV_BOOST_INCLUDEDIR)
  1268. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR})
  1269. endif()
  1270. if( BOOST_ROOT )
  1271. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT})
  1272. elseif( _ENV_BOOST_ROOT )
  1273. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT})
  1274. endif()
  1275. if( Boost_NO_SYSTEM_PATHS)
  1276. list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
  1277. else()
  1278. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
  1279. foreach(ver ${_boost_TEST_VERSIONS})
  1280. string(REPLACE "." "_" ver "${ver}")
  1281. list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
  1282. endforeach()
  1283. endif()
  1284. list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS
  1285. C:/boost/include
  1286. C:/boost
  1287. /sw/local/include
  1288. )
  1289. endif()
  1290. # Try to find Boost by stepping backwards through the Boost versions
  1291. # we know about.
  1292. # Build a list of path suffixes for each version.
  1293. set(_boost_PATH_SUFFIXES)
  1294. foreach(_boost_VER ${_boost_TEST_VERSIONS})
  1295. # Add in a path suffix, based on the required version, ideally
  1296. # we could read this from version.hpp, but for that to work we'd
  1297. # need to know the include dir already
  1298. set(_boost_BOOSTIFIED_VERSION)
  1299. # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
  1300. if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
  1301. set(_boost_BOOSTIFIED_VERSION
  1302. "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}")
  1303. elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)")
  1304. set(_boost_BOOSTIFIED_VERSION
  1305. "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
  1306. endif()
  1307. list(APPEND _boost_PATH_SUFFIXES
  1308. "boost-${_boost_BOOSTIFIED_VERSION}"
  1309. "boost_${_boost_BOOSTIFIED_VERSION}"
  1310. "boost/boost-${_boost_BOOSTIFIED_VERSION}"
  1311. "boost/boost_${_boost_BOOSTIFIED_VERSION}"
  1312. )
  1313. endforeach()
  1314. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_INCLUDE_SEARCH_DIRS")
  1315. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_PATH_SUFFIXES")
  1316. # Look for a standard boost header file.
  1317. find_path(Boost_INCLUDE_DIR
  1318. NAMES boost/config.hpp
  1319. HINTS ${_boost_INCLUDE_SEARCH_DIRS}
  1320. PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
  1321. )
  1322. endif()
  1323. # ------------------------------------------------------------------------
  1324. # Extract version information from version.hpp
  1325. # ------------------------------------------------------------------------
  1326. if(Boost_INCLUDE_DIR)
  1327. _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1328. "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
  1329. # Extract Boost_VERSION_MACRO and Boost_LIB_VERSION from version.hpp
  1330. set(Boost_VERSION_MACRO 0)
  1331. set(Boost_LIB_VERSION "")
  1332. file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
  1333. if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_VERSION ([0-9]+)")
  1334. set(Boost_VERSION_MACRO "${CMAKE_MATCH_1}")
  1335. endif()
  1336. if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
  1337. set(Boost_LIB_VERSION "${CMAKE_MATCH_1}")
  1338. endif()
  1339. unset(_boost_VERSION_HPP_CONTENTS)
  1340. # Calculate version components
  1341. math(EXPR Boost_VERSION_MAJOR "${Boost_VERSION_MACRO} / 100000")
  1342. math(EXPR Boost_VERSION_MINOR "${Boost_VERSION_MACRO} / 100 % 1000")
  1343. math(EXPR Boost_VERSION_PATCH "${Boost_VERSION_MACRO} % 100")
  1344. set(Boost_VERSION_COUNT 3)
  1345. # Define alias variables for backwards compat.
  1346. set(Boost_MAJOR_VERSION ${Boost_VERSION_MAJOR})
  1347. set(Boost_MINOR_VERSION ${Boost_VERSION_MINOR})
  1348. set(Boost_SUBMINOR_VERSION ${Boost_VERSION_PATCH})
  1349. # Define Boost version in x.y.z format
  1350. set(Boost_VERSION_STRING "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")
  1351. # Define final Boost_VERSION
  1352. cmake_policy(GET CMP0093 _Boost_CMP0093
  1353. PARENT_SCOPE # undocumented, do not use outside of CMake
  1354. )
  1355. if("x${_Boost_CMP0093}x" STREQUAL "xNEWx")
  1356. set(Boost_VERSION ${Boost_VERSION_STRING})
  1357. else()
  1358. set(Boost_VERSION ${Boost_VERSION_MACRO})
  1359. endif()
  1360. unset(_Boost_CMP0093)
  1361. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION")
  1362. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_STRING")
  1363. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MACRO")
  1364. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MAJOR")
  1365. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MINOR")
  1366. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_PATCH")
  1367. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_COUNT")
  1368. endif()
  1369. # ------------------------------------------------------------------------
  1370. # Prefix initialization
  1371. # ------------------------------------------------------------------------
  1372. set(Boost_LIB_PREFIX "")
  1373. if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR
  1374. (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) )
  1375. set(Boost_LIB_PREFIX "lib")
  1376. endif()
  1377. if ( NOT Boost_NAMESPACE )
  1378. set(Boost_NAMESPACE "boost")
  1379. endif()
  1380. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_LIB_PREFIX")
  1381. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_NAMESPACE")
  1382. # ------------------------------------------------------------------------
  1383. # Suffix initialization and compiler suffix detection.
  1384. # ------------------------------------------------------------------------
  1385. set(_Boost_VARS_NAME
  1386. Boost_NAMESPACE
  1387. Boost_COMPILER
  1388. Boost_THREADAPI
  1389. Boost_USE_DEBUG_PYTHON
  1390. Boost_USE_MULTITHREADED
  1391. Boost_USE_STATIC_LIBS
  1392. Boost_USE_STATIC_RUNTIME
  1393. Boost_USE_STLPORT
  1394. Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
  1395. )
  1396. _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME})
  1397. # Setting some more suffixes for the library
  1398. if (Boost_COMPILER)
  1399. set(_boost_COMPILER ${Boost_COMPILER})
  1400. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1401. "_boost_COMPILER" SOURCE "user-specified via Boost_COMPILER")
  1402. else()
  1403. # Attempt to guess the compiler suffix
  1404. # NOTE: this is not perfect yet, if you experience any issues
  1405. # please report them and use the Boost_COMPILER variable
  1406. # to work around the problems.
  1407. _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER)
  1408. endif()
  1409. set (_boost_MULTITHREADED "-mt")
  1410. if( NOT Boost_USE_MULTITHREADED )
  1411. set (_boost_MULTITHREADED "")
  1412. endif()
  1413. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_MULTITHREADED")
  1414. #======================
  1415. # Systematically build up the Boost ABI tag for the 'tagged' and 'versioned' layouts
  1416. # http://boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming
  1417. # http://boost.org/doc/libs/1_66_0/boost/config/auto_link.hpp
  1418. # http://boost.org/doc/libs/1_66_0/tools/build/src/tools/common.jam
  1419. # http://boost.org/doc/libs/1_66_0/boostcpp.jam
  1420. set( _boost_RELEASE_ABI_TAG "-")
  1421. set( _boost_DEBUG_ABI_TAG "-")
  1422. # Key Use this library when:
  1423. # s linking statically to the C++ standard library and
  1424. # compiler runtime support libraries.
  1425. if(Boost_USE_STATIC_RUNTIME)
  1426. set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
  1427. set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
  1428. endif()
  1429. # g using debug versions of the standard and runtime
  1430. # support libraries
  1431. if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
  1432. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
  1433. OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang"
  1434. OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
  1435. string(APPEND _boost_DEBUG_ABI_TAG "g")
  1436. endif()
  1437. endif()
  1438. # y using special debug build of python
  1439. if(Boost_USE_DEBUG_PYTHON)
  1440. string(APPEND _boost_DEBUG_ABI_TAG "y")
  1441. endif()
  1442. # d using a debug version of your code
  1443. string(APPEND _boost_DEBUG_ABI_TAG "d")
  1444. # p using the STLport standard library rather than the
  1445. # default one supplied with your compiler
  1446. if(Boost_USE_STLPORT)
  1447. string(APPEND _boost_RELEASE_ABI_TAG "p")
  1448. string(APPEND _boost_DEBUG_ABI_TAG "p")
  1449. endif()
  1450. # n using the STLport deprecated "native iostreams" feature
  1451. # removed from the documentation in 1.43.0 but still present in
  1452. # boost/config/auto_link.hpp
  1453. if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
  1454. string(APPEND _boost_RELEASE_ABI_TAG "n")
  1455. string(APPEND _boost_DEBUG_ABI_TAG "n")
  1456. endif()
  1457. # -x86 Architecture and address model tag
  1458. # First character is the architecture, then word-size, either 32 or 64
  1459. # Only used in 'versioned' layout, added in Boost 1.66.0
  1460. if(DEFINED Boost_ARCHITECTURE)
  1461. set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}")
  1462. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1463. "_boost_ARCHITECTURE_TAG" SOURCE "user-specified via Boost_ARCHITECTURE")
  1464. else()
  1465. set(_boost_ARCHITECTURE_TAG "")
  1466. # {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
  1467. if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION_STRING VERSION_LESS 1.66.0)
  1468. string(APPEND _boost_ARCHITECTURE_TAG "-")
  1469. # This needs to be kept in-sync with the section of CMakePlatformId.h.in
  1470. # inside 'defined(_WIN32) && defined(_MSC_VER)'
  1471. if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
  1472. string(APPEND _boost_ARCHITECTURE_TAG "i")
  1473. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
  1474. OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
  1475. string(APPEND _boost_ARCHITECTURE_TAG "x")
  1476. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
  1477. string(APPEND _boost_ARCHITECTURE_TAG "a")
  1478. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
  1479. string(APPEND _boost_ARCHITECTURE_TAG "m")
  1480. endif()
  1481. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  1482. string(APPEND _boost_ARCHITECTURE_TAG "64")
  1483. else()
  1484. string(APPEND _boost_ARCHITECTURE_TAG "32")
  1485. endif()
  1486. endif()
  1487. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1488. "_boost_ARCHITECTURE_TAG" SOURCE "detected")
  1489. endif()
  1490. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_RELEASE_ABI_TAG")
  1491. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_DEBUG_ABI_TAG")
  1492. # ------------------------------------------------------------------------
  1493. # Begin finding boost libraries
  1494. # ------------------------------------------------------------------------
  1495. set(_Boost_VARS_LIB "")
  1496. foreach(c DEBUG RELEASE)
  1497. set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c})
  1498. list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}})
  1499. _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR)
  1500. # Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the
  1501. # location did. We will find a new one based on the new inputs.
  1502. if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED)
  1503. unset(Boost_LIBRARY_DIR_${c} CACHE)
  1504. endif()
  1505. # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value.
  1506. if(Boost_LIBRARY_DIR_${c})
  1507. set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  1508. else()
  1509. set(_boost_LIBRARY_SEARCH_DIRS_${c} "")
  1510. if(BOOST_LIBRARYDIR)
  1511. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR})
  1512. elseif(_ENV_BOOST_LIBRARYDIR)
  1513. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR})
  1514. endif()
  1515. if(BOOST_ROOT)
  1516. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib)
  1517. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${BOOST_ROOT}")
  1518. elseif(_ENV_BOOST_ROOT)
  1519. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib)
  1520. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${_ENV_BOOST_ROOT}")
  1521. endif()
  1522. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c}
  1523. ${Boost_INCLUDE_DIR}/lib
  1524. ${Boost_INCLUDE_DIR}/../lib
  1525. ${Boost_INCLUDE_DIR}/stage/lib
  1526. )
  1527. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}/..")
  1528. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}")
  1529. if( Boost_NO_SYSTEM_PATHS )
  1530. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
  1531. else()
  1532. foreach(ver ${_boost_TEST_VERSIONS})
  1533. string(REPLACE "." "_" ver "${ver}")
  1534. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
  1535. endforeach()
  1536. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/boost")
  1537. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS
  1538. C:/boost/lib
  1539. C:/boost
  1540. /sw/local/lib
  1541. )
  1542. endif()
  1543. endif()
  1544. endforeach()
  1545. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_LIBRARY_SEARCH_DIRS_RELEASE")
  1546. _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_LIBRARY_SEARCH_DIRS_DEBUG")
  1547. # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  1548. if( Boost_USE_STATIC_LIBS )
  1549. set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  1550. if(WIN32)
  1551. list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)
  1552. else()
  1553. set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
  1554. endif()
  1555. endif()
  1556. # We want to use the tag inline below without risking double dashes
  1557. if(_boost_RELEASE_ABI_TAG)
  1558. if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
  1559. set(_boost_RELEASE_ABI_TAG "")
  1560. endif()
  1561. endif()
  1562. if(_boost_DEBUG_ABI_TAG)
  1563. if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
  1564. set(_boost_DEBUG_ABI_TAG "")
  1565. endif()
  1566. endif()
  1567. # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
  1568. # on WIN32 was to:
  1569. # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
  1570. # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
  1571. # We maintain this behavior since changing it could break people's builds.
  1572. # To disable the ambiguous behavior, the user need only
  1573. # set Boost_USE_STATIC_RUNTIME either ON or OFF.
  1574. set(_boost_STATIC_RUNTIME_WORKAROUND false)
  1575. if(WIN32 AND Boost_USE_STATIC_LIBS)
  1576. if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
  1577. set(_boost_STATIC_RUNTIME_WORKAROUND TRUE)
  1578. endif()
  1579. endif()
  1580. # On versions < 1.35, remove the System library from the considered list
  1581. # since it wasn't added until 1.35.
  1582. if(Boost_VERSION_STRING AND Boost_FIND_COMPONENTS)
  1583. if(Boost_VERSION_STRING VERSION_LESS 1.35.0)
  1584. list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
  1585. endif()
  1586. endif()
  1587. # Additional components may be required via component dependencies.
  1588. # Add any missing components to the list.
  1589. _Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
  1590. # If thread is required, get the thread libs as a dependency
  1591. if("thread" IN_LIST Boost_FIND_COMPONENTS)
  1592. if(Boost_FIND_QUIETLY)
  1593. set(_Boost_find_quiet QUIET)
  1594. else()
  1595. set(_Boost_find_quiet "")
  1596. endif()
  1597. find_package(Threads ${_Boost_find_quiet})
  1598. unset(_Boost_find_quiet)
  1599. endif()
  1600. # If the user changed any of our control inputs flush previous results.
  1601. if(_Boost_CHANGE_LIBDIR_DEBUG OR _Boost_CHANGE_LIBDIR_RELEASE OR _Boost_CHANGE_LIBNAME)
  1602. foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
  1603. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1604. foreach(c DEBUG RELEASE)
  1605. set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c})
  1606. unset(${_var} CACHE)
  1607. set(${_var} "${_var}-NOTFOUND")
  1608. endforeach()
  1609. endforeach()
  1610. set(_Boost_COMPONENTS_SEARCHED "")
  1611. endif()
  1612. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1613. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1614. set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
  1615. set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
  1616. # Compute component-specific hints.
  1617. set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
  1618. if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
  1619. ${COMPONENT} STREQUAL "graph_parallel")
  1620. foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
  1621. if(IS_ABSOLUTE "${lib}")
  1622. get_filename_component(libdir "${lib}" PATH)
  1623. string(REPLACE "\\" "/" libdir "${libdir}")
  1624. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir})
  1625. endif()
  1626. endforeach()
  1627. endif()
  1628. # Handle Python version suffixes
  1629. unset(COMPONENT_PYTHON_VERSION_MAJOR)
  1630. unset(COMPONENT_PYTHON_VERSION_MINOR)
  1631. if(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\$")
  1632. set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
  1633. set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
  1634. elseif(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\\.?([0-9])\$")
  1635. set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
  1636. set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
  1637. set(COMPONENT_PYTHON_VERSION_MINOR "${CMAKE_MATCH_3}")
  1638. endif()
  1639. unset(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1640. if (COMPONENT_PYTHON_VERSION_MINOR)
  1641. # Boost >= 1.67
  1642. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1643. # Debian/Ubuntu (Some versions omit the 2 and/or 3 from the suffix)
  1644. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1645. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1646. # Gentoo
  1647. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
  1648. # RPMs
  1649. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1650. endif()
  1651. if (COMPONENT_PYTHON_VERSION_MAJOR AND NOT COMPONENT_PYTHON_VERSION_MINOR)
  1652. # Boost < 1.67
  1653. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}")
  1654. endif()
  1655. # Consolidate and report component-specific hints.
  1656. if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1657. list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1658. _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1659. "Component-specific library search names for ${COMPONENT_NAME}: ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME}")
  1660. endif()
  1661. if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  1662. list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  1663. _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1664. "Component-specific library search paths for ${COMPONENT}: ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}")
  1665. endif()
  1666. #
  1667. # Find headers
  1668. #
  1669. _Boost_COMPONENT_HEADERS("${COMPONENT}" Boost_${UPPERCOMPONENT}_HEADER_NAME)
  1670. # Look for a standard boost header file.
  1671. if(Boost_${UPPERCOMPONENT}_HEADER_NAME)
  1672. if(EXISTS "${Boost_INCLUDE_DIR}/${Boost_${UPPERCOMPONENT}_HEADER_NAME}")
  1673. set(Boost_${UPPERCOMPONENT}_HEADER ON)
  1674. else()
  1675. set(Boost_${UPPERCOMPONENT}_HEADER OFF)
  1676. endif()
  1677. else()
  1678. set(Boost_${UPPERCOMPONENT}_HEADER ON)
  1679. message(WARNING "No header defined for ${COMPONENT}; skipping header check")
  1680. endif()
  1681. #
  1682. # Find RELEASE libraries
  1683. #
  1684. unset(_boost_RELEASE_NAMES)
  1685. foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
  1686. foreach(compiler IN LISTS _boost_COMPILER)
  1687. list(APPEND _boost_RELEASE_NAMES
  1688. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1689. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1690. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
  1691. endforeach()
  1692. list(APPEND _boost_RELEASE_NAMES
  1693. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1694. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1695. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
  1696. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
  1697. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
  1698. if(_boost_STATIC_RUNTIME_WORKAROUND)
  1699. set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
  1700. foreach(compiler IN LISTS _boost_COMPILER)
  1701. list(APPEND _boost_RELEASE_NAMES
  1702. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1703. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1704. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
  1705. endforeach()
  1706. list(APPEND _boost_RELEASE_NAMES
  1707. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1708. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1709. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
  1710. endif()
  1711. endforeach()
  1712. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  1713. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
  1714. endif()
  1715. _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1716. "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
  1717. # if Boost_LIBRARY_DIR_RELEASE is not defined,
  1718. # but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs
  1719. if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG)
  1720. list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG})
  1721. endif()
  1722. # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
  1723. string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}")
  1724. if(Boost_USE_RELEASE_LIBS)
  1725. _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE
  1726. NAMES ${_boost_RELEASE_NAMES}
  1727. HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
  1728. NAMES_PER_DIR
  1729. DOC "${_boost_docstring_release}"
  1730. )
  1731. endif()
  1732. #
  1733. # Find DEBUG libraries
  1734. #
  1735. unset(_boost_DEBUG_NAMES)
  1736. foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
  1737. foreach(compiler IN LISTS _boost_COMPILER)
  1738. list(APPEND _boost_DEBUG_NAMES
  1739. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1740. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1741. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
  1742. endforeach()
  1743. list(APPEND _boost_DEBUG_NAMES
  1744. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1745. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1746. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
  1747. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
  1748. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
  1749. if(_boost_STATIC_RUNTIME_WORKAROUND)
  1750. set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
  1751. foreach(compiler IN LISTS _boost_COMPILER)
  1752. list(APPEND _boost_DEBUG_NAMES
  1753. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1754. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1755. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
  1756. endforeach()
  1757. list(APPEND _boost_DEBUG_NAMES
  1758. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1759. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1760. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
  1761. endif()
  1762. endforeach()
  1763. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  1764. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
  1765. endif()
  1766. _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
  1767. "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
  1768. # if Boost_LIBRARY_DIR_DEBUG is not defined,
  1769. # but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs
  1770. if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE)
  1771. list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE})
  1772. endif()
  1773. # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
  1774. string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
  1775. if(Boost_USE_DEBUG_LIBS)
  1776. _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG
  1777. NAMES ${_boost_DEBUG_NAMES}
  1778. HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
  1779. NAMES_PER_DIR
  1780. DOC "${_boost_docstring_debug}"
  1781. )
  1782. endif ()
  1783. if(Boost_REALPATH)
  1784. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
  1785. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" )
  1786. endif()
  1787. _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
  1788. # Check if component requires some compiler features
  1789. _Boost_COMPILER_FEATURES(${COMPONENT} _Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
  1790. endforeach()
  1791. # Restore the original find library ordering
  1792. if( Boost_USE_STATIC_LIBS )
  1793. set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  1794. endif()
  1795. # ------------------------------------------------------------------------
  1796. # End finding boost libraries
  1797. # ------------------------------------------------------------------------
  1798. set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
  1799. set(Boost_LIBRARY_DIRS)
  1800. if(Boost_LIBRARY_DIR_RELEASE)
  1801. list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE})
  1802. endif()
  1803. if(Boost_LIBRARY_DIR_DEBUG)
  1804. list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG})
  1805. endif()
  1806. if(Boost_LIBRARY_DIRS)
  1807. list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
  1808. endif()
  1809. # ------------------------------------------------------------------------
  1810. # Call FPHSA helper, see https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html
  1811. # ------------------------------------------------------------------------
  1812. # Define aliases as needed by the component handler in the FPHSA helper below
  1813. foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
  1814. string(TOUPPER ${_comp} _uppercomp)
  1815. if(DEFINED Boost_${_uppercomp}_FOUND)
  1816. set(Boost_${_comp}_FOUND ${Boost_${_uppercomp}_FOUND})
  1817. endif()
  1818. endforeach()
  1819. find_package_handle_standard_args(Boost
  1820. REQUIRED_VARS Boost_INCLUDE_DIR
  1821. VERSION_VAR Boost_VERSION_STRING
  1822. HANDLE_COMPONENTS)
  1823. if(Boost_FOUND)
  1824. if( NOT Boost_LIBRARY_DIRS )
  1825. # Compatibility Code for backwards compatibility with CMake
  1826. # 2.4's FindBoost module.
  1827. # Look for the boost library path.
  1828. # Note that the user may not have installed any libraries
  1829. # so it is quite possible the Boost_LIBRARY_DIRS may not exist.
  1830. set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
  1831. if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
  1832. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1833. endif()
  1834. if("${_boost_LIB_DIR}" MATCHES "/include$")
  1835. # Strip off the trailing "/include" in the path.
  1836. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1837. endif()
  1838. if(EXISTS "${_boost_LIB_DIR}/lib")
  1839. string(APPEND _boost_LIB_DIR /lib)
  1840. elseif(EXISTS "${_boost_LIB_DIR}/stage/lib")
  1841. string(APPEND _boost_LIB_DIR "/stage/lib")
  1842. else()
  1843. set(_boost_LIB_DIR "")
  1844. endif()
  1845. if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
  1846. set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR})
  1847. endif()
  1848. endif()
  1849. else()
  1850. # Boost headers were not found so no components were found.
  1851. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1852. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1853. set(Boost_${UPPERCOMPONENT}_FOUND 0)
  1854. endforeach()
  1855. endif()
  1856. # ------------------------------------------------------------------------
  1857. # Add imported targets
  1858. # ------------------------------------------------------------------------
  1859. if(Boost_FOUND)
  1860. # The builtin CMake package in Boost 1.70+ introduces a new name
  1861. # for the header-only lib, let's provide the same UI in module mode
  1862. if(NOT TARGET Boost::headers)
  1863. add_library(Boost::headers INTERFACE IMPORTED)
  1864. if(Boost_INCLUDE_DIRS)
  1865. set_target_properties(Boost::headers PROPERTIES
  1866. INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
  1867. endif()
  1868. endif()
  1869. # Define the old target name for header-only libraries for backwards
  1870. # compat.
  1871. if(NOT TARGET Boost::boost)
  1872. add_library(Boost::boost INTERFACE IMPORTED)
  1873. set_target_properties(Boost::boost
  1874. PROPERTIES INTERFACE_LINK_LIBRARIES Boost::headers)
  1875. endif()
  1876. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1877. if(_Boost_IMPORTED_TARGETS AND NOT TARGET Boost::${COMPONENT})
  1878. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1879. if(Boost_${UPPERCOMPONENT}_FOUND)
  1880. if(Boost_USE_STATIC_LIBS)
  1881. add_library(Boost::${COMPONENT} STATIC IMPORTED)
  1882. else()
  1883. # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
  1884. # libraries as a result.
  1885. add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
  1886. endif()
  1887. if(Boost_INCLUDE_DIRS)
  1888. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1889. INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
  1890. endif()
  1891. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
  1892. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1893. IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
  1894. IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
  1895. endif()
  1896. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
  1897. set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
  1898. IMPORTED_CONFIGURATIONS RELEASE)
  1899. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1900. IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
  1901. IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
  1902. endif()
  1903. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
  1904. set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
  1905. IMPORTED_CONFIGURATIONS DEBUG)
  1906. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1907. IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
  1908. IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
  1909. endif()
  1910. if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
  1911. unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
  1912. foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
  1913. list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
  1914. endforeach()
  1915. if(COMPONENT STREQUAL "thread")
  1916. list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
  1917. endif()
  1918. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1919. INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
  1920. endif()
  1921. if(_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
  1922. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1923. INTERFACE_COMPILE_FEATURES "${_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES}")
  1924. endif()
  1925. endif()
  1926. endif()
  1927. endforeach()
  1928. endif()
  1929. # ------------------------------------------------------------------------
  1930. # Finalize
  1931. # ------------------------------------------------------------------------
  1932. # Report Boost_LIBRARIES
  1933. set(Boost_LIBRARIES "")
  1934. foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
  1935. string(TOUPPER ${_comp} _uppercomp)
  1936. if(Boost_${_uppercomp}_FOUND)
  1937. list(APPEND Boost_LIBRARIES ${Boost_${_uppercomp}_LIBRARY})
  1938. if(_comp STREQUAL "thread")
  1939. list(APPEND Boost_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
  1940. endif()
  1941. endif()
  1942. endforeach()
  1943. # Configure display of cache entries in GUI.
  1944. foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB})
  1945. get_property(_type CACHE ${v} PROPERTY TYPE)
  1946. if(_type)
  1947. set_property(CACHE ${v} PROPERTY ADVANCED 1)
  1948. if("x${_type}" STREQUAL "xUNINITIALIZED")
  1949. if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS")
  1950. set_property(CACHE ${v} PROPERTY TYPE STRING)
  1951. else()
  1952. set_property(CACHE ${v} PROPERTY TYPE PATH)
  1953. endif()
  1954. endif()
  1955. endif()
  1956. endforeach()
  1957. # Record last used values of input variables so we can
  1958. # detect on the next run if the user changed them.
  1959. foreach(v
  1960. ${_Boost_VARS_INC} ${_Boost_VARS_LIB}
  1961. ${_Boost_VARS_DIR} ${_Boost_VARS_NAME}
  1962. )
  1963. if(DEFINED ${v})
  1964. set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.")
  1965. else()
  1966. unset(_${v}_LAST CACHE)
  1967. endif()
  1968. endforeach()
  1969. # Maintain a persistent list of components requested anywhere since
  1970. # the last flush.
  1971. set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}")
  1972. list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS})
  1973. list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED)
  1974. list(SORT _Boost_COMPONENTS_SEARCHED)
  1975. set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}"
  1976. CACHE INTERNAL "Components requested for this build tree.")
  1977. # Restore project's policies
  1978. cmake_policy(POP)