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