FindBoost.cmake 115 KB

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