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