FindBoost.cmake 108 KB

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