Don't convert map/set values within sorted_iter_to_ocaml_{map,set}
[hiphop-php.git] / CMake / FindBoost.cmake
blobb26bd369925eecb350855b4ff1c0f09e3713dc4a
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(FindPackageHandleStandardArgs)
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)
391 function(_boost_get_existing_target component target_var)
392   set(names "${component}")
393   if(component MATCHES "^([a-z_]*)(python|numpy)([1-9])\\.?([0-9])?$")
394     # handle pythonXY and numpyXY versioned components and also python X.Y, mpi_python etc.
395     list(APPEND names
396       "${CMAKE_MATCH_1}${CMAKE_MATCH_2}" # python
397       "${CMAKE_MATCH_1}${CMAKE_MATCH_2}${CMAKE_MATCH_3}" # pythonX
398       "${CMAKE_MATCH_1}${CMAKE_MATCH_2}${CMAKE_MATCH_3}${CMAKE_MATCH_4}" #pythonXY
399     )
400   endif()
401   # https://github.com/boost-cmake/boost-cmake uses boost::file_system etc.
402   # So handle similar constructions of target names
403   string(TOLOWER "${component}" lower_component)
404   list(APPEND names "${lower_component}")
405   foreach(prefix Boost boost)
406     foreach(name IN LISTS names)
407       if(TARGET "${prefix}::${name}")
408         # The target may be an INTERFACE library that wraps around a single other
409         # target for compatibility.  Unwrap this layer so we can extract real info.
410         if("${name}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
411           set(name_nv "${CMAKE_MATCH_1}")
412           if(TARGET "${prefix}::${name_nv}")
413             get_property(type TARGET "${prefix}::${name}" PROPERTY TYPE)
414             if(type STREQUAL "INTERFACE_LIBRARY")
415               get_property(lib TARGET "${prefix}::${name}" PROPERTY INTERFACE_LINK_LIBRARIES)
416               if("${lib}" STREQUAL "${prefix}::${name_nv}")
417                 set(${target_var} "${prefix}::${name_nv}" PARENT_SCOPE)
418                 return()
419               endif()
420             endif()
421           endif()
422         endif()
423         set(${target_var} "${prefix}::${name}" PARENT_SCOPE)
424         return()
425       endif()
426     endforeach()
427   endforeach()
428   set(${target_var} "" PARENT_SCOPE)
429 endfunction()
431 function(_boost_get_canonical_target_name component target_var)
432   string(TOLOWER "${component}" component)
433   if(component MATCHES "^([a-z_]*)(python|numpy)([1-9])\\.?([0-9])?$")
434     # handle pythonXY and numpyXY versioned components and also python X.Y, mpi_python etc.
435     set(${target_var} "Boost::${CMAKE_MATCH_1}${CMAKE_MATCH_2}" PARENT_SCOPE)
436   else()
437     set(${target_var} "Boost::${component}" PARENT_SCOPE)
438   endif()
439 endfunction()
441 macro(_boost_set_in_parent_scope name value)
442   # Set a variable in parent scope and make it visible in current scope
443   set(${name} "${value}" PARENT_SCOPE)
444   set(${name} "${value}")
445 endmacro()
447 macro(_boost_set_if_unset name value)
448   if(NOT ${name})
449     _boost_set_in_parent_scope(${name} "${value}")
450   endif()
451 endmacro()
453 macro(_boost_set_cache_if_unset name value)
454   if(NOT ${name})
455     set(${name} "${value}" CACHE STRING "" FORCE)
456   endif()
457 endmacro()
459 macro(_boost_append_include_dir target)
460   get_target_property(inc "${target}" INTERFACE_INCLUDE_DIRECTORIES)
461   if(inc)
462     list(APPEND include_dirs "${inc}")
463   endif()
464 endmacro()
466 function(_boost_set_legacy_variables_from_config)
467   # Set legacy variables for compatibility if not set
468   set(include_dirs "")
469   set(library_dirs "")
470   set(libraries "")
471   # Header targets Boost::headers or Boost::boost
472   foreach(comp headers boost)
473     _boost_get_existing_target(${comp} target)
474     if(target)
475       _boost_append_include_dir("${target}")
476     endif()
477   endforeach()
478   # Library targets
479   foreach(comp IN LISTS Boost_FIND_COMPONENTS)
480     string(TOUPPER ${comp} uppercomp)
481     # Overwrite if set
482     _boost_set_in_parent_scope(Boost_${uppercomp}_FOUND "${Boost_${comp}_FOUND}")
483     if(Boost_${comp}_FOUND)
484       _boost_get_existing_target(${comp} target)
485       if(NOT target)
486         if(Boost_DEBUG OR Boost_VERBOSE)
487           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.")
488         endif()
489         continue()
490       endif()
491       _boost_append_include_dir("${target}")
492       _boost_set_if_unset(Boost_${uppercomp}_LIBRARY "${target}")
493       _boost_set_if_unset(Boost_${uppercomp}_LIBRARIES "${target}") # Very old legacy variable
494       list(APPEND libraries "${target}")
495       get_property(type TARGET "${target}" PROPERTY TYPE)
496       if(NOT type STREQUAL "INTERFACE_LIBRARY")
497         foreach(cfg RELEASE DEBUG)
498           get_target_property(lib ${target} IMPORTED_LOCATION_${cfg})
499           if(lib)
500             get_filename_component(lib_dir "${lib}" DIRECTORY)
501             list(APPEND library_dirs ${lib_dir})
502             _boost_set_cache_if_unset(Boost_${uppercomp}_LIBRARY_${cfg} "${lib}")
503           endif()
504         endforeach()
505       elseif(Boost_DEBUG OR Boost_VERBOSE)
506         # For projects using only the Boost::* targets this warning can be safely ignored.
507         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.")
508       endif()
509       _boost_get_canonical_target_name("${comp}" canonical_target)
510       if(NOT TARGET "${canonical_target}")
511         add_library("${canonical_target}" INTERFACE IMPORTED)
512         target_link_libraries("${canonical_target}" INTERFACE "${target}")
513       endif()
514     endif()
515   endforeach()
516   list(REMOVE_DUPLICATES include_dirs)
517   list(REMOVE_DUPLICATES library_dirs)
518   _boost_set_if_unset(Boost_INCLUDE_DIRS "${include_dirs}")
519   _boost_set_if_unset(Boost_LIBRARY_DIRS "${library_dirs}")
520   _boost_set_if_unset(Boost_LIBRARIES "${libraries}")
521   _boost_set_if_unset(Boost_VERSION_STRING "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")
522   find_path(Boost_INCLUDE_DIR
523     NAMES boost/version.hpp boost/config.hpp
524     HINTS ${Boost_INCLUDE_DIRS}
525     NO_DEFAULT_PATH
526   )
527   if(NOT Boost_VERSION_MACRO OR NOT Boost_LIB_VERSION)
528     set(version_file ${Boost_INCLUDE_DIR}/boost/version.hpp)
529     if(EXISTS "${version_file}")
530       file(STRINGS "${version_file}" contents REGEX "#define BOOST_(LIB_)?VERSION ")
531       if(contents MATCHES "#define BOOST_VERSION ([0-9]+)")
532         _boost_set_if_unset(Boost_VERSION_MACRO "${CMAKE_MATCH_1}")
533       endif()
534       if(contents MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
535         _boost_set_if_unset(Boost_LIB_VERSION "${CMAKE_MATCH_1}")
536       endif()
537     endif()
538   endif()
539   _boost_set_if_unset(Boost_MAJOR_VERSION ${Boost_VERSION_MAJOR})
540   _boost_set_if_unset(Boost_MINOR_VERSION ${Boost_VERSION_MINOR})
541   _boost_set_if_unset(Boost_SUBMINOR_VERSION ${Boost_VERSION_PATCH})
542   if(WIN32)
543     _boost_set_if_unset(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
544   endif()
545   if(NOT TARGET Boost::headers)
546     add_library(Boost::headers INTERFACE IMPORTED)
547     target_include_directories(Boost::headers INTERFACE ${Boost_INCLUDE_DIRS})
548   endif()
549   # Legacy targets w/o functionality as all handled by defined targets
550   foreach(lib diagnostic_definitions disable_autolinking dynamic_linking)
551     if(NOT TARGET Boost::${lib})
552       add_library(Boost::${lib} INTERFACE IMPORTED)
553     endif()
554   endforeach()
555   if(NOT TARGET Boost::boost)
556     add_library(Boost::boost INTERFACE IMPORTED)
557     target_link_libraries(Boost::boost INTERFACE Boost::headers)
558   endif()
559 endfunction()
561 #-------------------------------------------------------------------------------
562 # Before we go searching, check whether a boost cmake package is available, unless
563 # the user specifically asked NOT to search for one.
565 # If Boost_DIR is set, this behaves as any find_package call would. If not,
566 # it looks at BOOST_ROOT and BOOSTROOT to find Boost.
568 if (NOT Boost_NO_BOOST_CMAKE)
569   # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives,
570   # since these are more conventional for Boost.
571   if ("$ENV{Boost_DIR}" STREQUAL "")
572     if (NOT "$ENV{BOOST_ROOT}" STREQUAL "")
573       set(ENV{Boost_DIR} $ENV{BOOST_ROOT})
574     elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "")
575       set(ENV{Boost_DIR} $ENV{BOOSTROOT})
576     endif()
577   endif()
579   set(_boost_FIND_PACKAGE_ARGS "")
580   if(Boost_NO_SYSTEM_PATHS)
581     list(APPEND _boost_FIND_PACKAGE_ARGS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
582   endif()
584   # Do the same find_package call but look specifically for the CMake version.
585   # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
586   # need to delegate them to this find_package call.
587   if(BOOST_ROOT AND NOT Boost_ROOT)
588     # Honor BOOST_ROOT by setting Boost_ROOT with CMP0074 NEW behavior.
589     cmake_policy(PUSH)
590     #cmake_policy(SET CMP0074 NEW)
591     set(Boost_ROOT "${BOOST_ROOT}")
592     set(_Boost_ROOT_FOR_CONFIG 1)
593   endif()
594   find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS})
595   if(_Boost_ROOT_FOR_CONFIG)
596     unset(_Boost_ROOT_FOR_CONFIG)
597     unset(Boost_ROOT)
598     cmake_policy(POP)
599   endif()
600   if (DEFINED Boost_DIR)
601     mark_as_advanced(Boost_DIR)
602   endif ()
604   # If we found a boost cmake package, then we're done. Print out what we found.
605   # Otherwise let the rest of the module try to find it.
606   if(Boost_FOUND)
607     # Convert component found variables to standard variables if required
608     # Necessary for legacy boost-cmake and 1.70 builtin BoostConfig
609     if(Boost_FIND_COMPONENTS)
610       # Ignore the meta-component "ALL", introduced by Boost 1.73
611       list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL")
613       foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
614         if(DEFINED Boost_${_comp}_FOUND)
615           continue()
616         endif()
617         string(TOUPPER ${_comp} _uppercomp)
618         if(DEFINED Boost${_comp}_FOUND) # legacy boost-cmake project
619           set(Boost_${_comp}_FOUND ${Boost${_comp}_FOUND})
620         elseif(DEFINED Boost_${_uppercomp}_FOUND) # Boost 1.70
621           set(Boost_${_comp}_FOUND ${Boost_${_uppercomp}_FOUND})
622         endif()
623       endforeach()
624     endif()
626     find_package_handle_standard_args(Boost HANDLE_COMPONENTS CONFIG_MODE)
627     _boost_set_legacy_variables_from_config()
629     # Restore project's policies
630     cmake_policy(POP)
631     return()
632   endif()
633 endif()
636 #-------------------------------------------------------------------------------
637 #  FindBoost functions & macros
641 # Print debug text if Boost_DEBUG is set.
642 # Call example:
643 # _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "debug message")
645 function(_Boost_DEBUG_PRINT file line text)
646   if(Boost_DEBUG)
647     message(STATUS "[ ${file}:${line} ] ${text}")
648   endif()
649 endfunction()
652 # _Boost_DEBUG_PRINT_VAR(file line variable_name [ENVIRONMENT]
653 #                        [SOURCE "short explanation of origin of var value"])
655 #   ENVIRONMENT - look up environment variable instead of CMake variable
657 # Print variable name and its value if Boost_DEBUG is set.
658 # Call example:
659 # _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" BOOST_ROOT)
661 function(_Boost_DEBUG_PRINT_VAR file line name)
662   if(Boost_DEBUG)
663     cmake_parse_arguments(_args "ENVIRONMENT" "SOURCE" "" ${ARGN})
665     unset(source)
666     if(_args_SOURCE)
667       set(source " (${_args_SOURCE})")
668     endif()
670     if(_args_ENVIRONMENT)
671       if(DEFINED ENV{${name}})
672         set(value "\"$ENV{${name}}\"")
673       else()
674         set(value "<unset>")
675       endif()
676       set(_name "ENV{${name}}")
677     else()
678       if(DEFINED "${name}")
679         set(value "\"${${name}}\"")
680       else()
681         set(value "<unset>")
682       endif()
683       set(_name "${name}")
684     endif()
686     _Boost_DEBUG_PRINT("${file}" "${line}" "${_name} = ${value}${source}")
687   endif()
688 endfunction()
690 ############################################
692 # Check the existence of the libraries.
694 ############################################
695 # This macro was taken directly from the FindQt4.cmake file that is included
696 # with the CMake distribution. This is NOT my work. All work was done by the
697 # original authors of the FindQt4.cmake file. Only minor modifications were
698 # made to remove references to Qt and make this file more generally applicable
699 # And ELSE/ENDIF pairs were removed for readability.
700 #########################################################################
702 macro(_Boost_ADJUST_LIB_VARS basename)
703   if(Boost_INCLUDE_DIR )
704     if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
705       # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
706       # single-config generators, set optimized and debug libraries
707       get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
708       if(_isMultiConfig OR CMAKE_BUILD_TYPE)
709         set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
710       else()
711         # For single-config generators where CMAKE_BUILD_TYPE has no value,
712         # just use the release libraries
713         set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
714       endif()
715       # FIXME: This probably should be set for both cases
716       set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
717     endif()
719     # if only the release version was found, set the debug variable also to the release version
720     if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
721       set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
722       set(Boost_${basename}_LIBRARY       ${Boost_${basename}_LIBRARY_RELEASE})
723       set(Boost_${basename}_LIBRARIES     ${Boost_${basename}_LIBRARY_RELEASE})
724     endif()
726     # if only the debug version was found, set the release variable also to the debug version
727     if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
728       set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
729       set(Boost_${basename}_LIBRARY         ${Boost_${basename}_LIBRARY_DEBUG})
730       set(Boost_${basename}_LIBRARIES       ${Boost_${basename}_LIBRARY_DEBUG})
731     endif()
733     # If the debug & release library ends up being the same, omit the keywords
734     if("${Boost_${basename}_LIBRARY_RELEASE}" STREQUAL "${Boost_${basename}_LIBRARY_DEBUG}")
735       set(Boost_${basename}_LIBRARY   ${Boost_${basename}_LIBRARY_RELEASE} )
736       set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
737     endif()
739     if(Boost_${basename}_LIBRARY AND Boost_${basename}_HEADER)
740       set(Boost_${basename}_FOUND ON)
741       if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads)
742         string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)")
743         set(Boost_THREAD_FOUND OFF)
744       endif()
745     endif()
747   endif()
748   # Make variables changeable to the advanced user
749   mark_as_advanced(
750       Boost_${basename}_LIBRARY_RELEASE
751       Boost_${basename}_LIBRARY_DEBUG
752   )
753 endmacro()
755 # Detect changes in used variables.
756 # Compares the current variable value with the last one.
757 # In short form:
758 # v != v_LAST                      -> CHANGED = 1
759 # v is defined, v_LAST not         -> CHANGED = 1
760 # v is not defined, but v_LAST is  -> CHANGED = 1
761 # otherwise                        -> CHANGED = 0
762 # CHANGED is returned in variable named ${changed_var}
763 macro(_Boost_CHANGE_DETECT changed_var)
764   set(${changed_var} 0)
765   foreach(v ${ARGN})
766     if(DEFINED _Boost_COMPONENTS_SEARCHED)
767       if(${v})
768         if(_${v}_LAST)
769           string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED)
770         else()
771           set(_${v}_CHANGED 1)
772         endif()
773       elseif(_${v}_LAST)
774         set(_${v}_CHANGED 1)
775       endif()
776       if(_${v}_CHANGED)
777         set(${changed_var} 1)
778       endif()
779     else()
780       set(_${v}_CHANGED 0)
781     endif()
782   endforeach()
783 endmacro()
786 # Find the given library (var).
787 # Use 'build_type' to support different lib paths for RELEASE or DEBUG builds
789 macro(_Boost_FIND_LIBRARY var build_type)
791   find_library(${var} ${ARGN})
793   if(${var})
794     # If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
795     if(NOT Boost_LIBRARY_DIR_${build_type})
796       get_filename_component(_dir "${${var}}" PATH)
797       set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE)
798     endif()
799   elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
800     # Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
801     find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN})
802   endif()
804   # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there.
805   if(Boost_LIBRARY_DIR_${build_type})
806     set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
807     _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
808                            "Boost_LIBRARY_DIR_${build_type}")
809     _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
810                            "_boost_LIBRARY_SEARCH_DIRS_${build_type}")
811   endif()
812 endmacro()
814 #-------------------------------------------------------------------------------
816 # Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
817 function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
818   string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
819     _boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
820   string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
821     _boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
823   set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
825   set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
826   set(${_OUTPUT_VERSION_MAJOR} ${_boost_COMPILER_VERSION_MAJOR} PARENT_SCOPE)
827   set(${_OUTPUT_VERSION_MINOR} ${_boost_COMPILER_VERSION_MINOR} PARENT_SCOPE)
828 endfunction()
831 # Take a list of libraries with "thread" in it
832 # and prepend duplicates with "thread_${Boost_THREADAPI}"
833 # at the front of the list
835 function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
836   set(_orig_libnames ${ARGN})
837   string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}")
838   set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
839 endfunction()
842 # If a library is found, replace its cache entry with its REALPATH
844 function(_Boost_SWAP_WITH_REALPATH _library _docstring)
845   if(${_library})
846     get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
847     unset(${_library} CACHE)
848     set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
849   endif()
850 endfunction()
852 function(_Boost_CHECK_SPELLING _var)
853   if(${_var})
854     string(TOUPPER ${_var} _var_UC)
855     message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling.  The proper spelling is ${_var_UC}.")
856   endif()
857 endfunction()
859 # Guesses Boost's compiler prefix used in built library names
860 # Returns the guess by setting the variable pointed to by _ret
861 function(_Boost_GUESS_COMPILER_PREFIX _ret)
862   if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel"
863       OR "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "xIntelLLVM")
864     if(WIN32)
865       set (_boost_COMPILER "-iw")
866     else()
867       set (_boost_COMPILER "-il")
868     endif()
869   elseif (GHSMULTI)
870     set(_boost_COMPILER "-ghs")
871   elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
872     if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
873       # Not yet known.
874       set(_boost_COMPILER "")
875     elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
876       # MSVC toolset 14.x versions are forward compatible.
877       set(_boost_COMPILER "")
878       foreach(v 9 8 7 6 5 4 3 2 1 0)
879         if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
880           list(APPEND _boost_COMPILER "-vc14${v}")
881         endif()
882       endforeach()
883     elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
884       set(_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION}")
885     elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
886       set(_boost_COMPILER "-vc71")
887     elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
888       set(_boost_COMPILER "-vc7") # yes, this is correct
889     else() # VS 6.0 Good luck!
890       set(_boost_COMPILER "-vc6") # yes, this is correct
891     endif()
893     if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
894       string(REPLACE "." ";" VERSION_LIST "${CMAKE_CXX_COMPILER_VERSION}")
895       list(GET VERSION_LIST 0 CLANG_VERSION_MAJOR)
896       set(_boost_COMPILER "-clangw${CLANG_VERSION_MAJOR};${_boost_COMPILER}")
897     endif()
898   elseif (BORLAND)
899     set(_boost_COMPILER "-bcb")
900   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
901     set(_boost_COMPILER "-sw")
902   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
903     set(_boost_COMPILER "-xlc")
904   elseif (MINGW)
905     if(Boost_VERSION_STRING VERSION_LESS 1.34)
906         set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
907     else()
908       _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
909       if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.73 AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER_EQUAL 5)
910         set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION_MAJOR}")
911       else()
912         set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
913       endif()
914     endif()
915   elseif (UNIX)
916     _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
917     if(NOT Boost_VERSION_STRING VERSION_LESS 1.69.0)
918       # From GCC 5 and clang 4, versioning changes and minor becomes patch.
919       # For those compilers, patch is exclude from compiler tag in Boost 1.69+ library naming.
920       if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 4)
921         set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
922       elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 3)
923         set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
924       endif()
925     endif()
927     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
928       if(Boost_VERSION_STRING VERSION_LESS 1.34)
929         set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
930       else()
931         # Determine which version of GCC we have.
932         if(APPLE)
933           if(Boost_VERSION_STRING VERSION_LESS 1.36.0)
934             # In Boost <= 1.35.0, there is no mangled compiler name for
935             # the macOS/Darwin version of GCC.
936             set(_boost_COMPILER "")
937           else()
938             # In Boost 1.36.0 and newer, the mangled compiler name used
939             # on macOS/Darwin is "xgcc".
940             set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
941           endif()
942         else()
943           set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
944         endif()
945       endif()
946     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
947       # TODO: Find out any Boost version constraints vs clang support.
948       set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")
949     endif()
950   else()
951     set(_boost_COMPILER "")
952   endif()
953   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
954                          "_boost_COMPILER" SOURCE "guessed")
955   set(${_ret} ${_boost_COMPILER} PARENT_SCOPE)
956 endfunction()
959 # Get component dependencies.  Requires the dependencies to have been
960 # defined for the Boost release version.
962 # component - the component to check
963 # _ret - list of library dependencies
965 function(_Boost_COMPONENT_DEPENDENCIES component _ret)
966   # Note: to add a new Boost release, run
967   #
968   #   % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
969   #
970   # The output may be added in a new block below.  If it's the same as
971   # the previous release, simply update the version range of the block
972   # for the previous release.  Also check if any new components have
973   # been added, and add any new components to
974   # _Boost_COMPONENT_HEADERS.
975   #
976   # This information was originally generated by running
977   # BoostScanDeps.cmake against every boost release to date supported
978   # by FindBoost:
979   #
980   #   % for version in /path/to/boost/sources/*
981   #     do
982   #       cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
983   #     done
984   #
985   # The output was then updated by search and replace with these regexes:
986   #
987   # - Strip message(STATUS) prefix dashes
988   #   s;^-- ;;
989   # - Indent
990   #   s;^set(;    set(;;
991   # - Add conditionals
992   #   s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*);  elseif(NOT Boost_VERSION_STRING VERSION_LESS \1\.\2\.\3 AND Boost_VERSION_STRING VERSION_LESS xxxx);
993   #
994   # This results in the logic seen below, but will require the xxxx
995   # replacing with the following Boost release version (or the next
996   # minor version to be released, e.g. 1.59 was the latest at the time
997   # of writing, making 1.60 the next. Identical consecutive releases
998   # were then merged together by updating the end range of the first
999   # block and removing the following redundant blocks.
1000   #
1001   # Running the script against all historical releases should be
1002   # required only if the BoostScanDeps.cmake script logic is changed.
1003   # The addition of a new release should only require it to be run
1004   # against the new release.
1006   # Handle Python version suffixes
1007   if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
1008     set(component "${CMAKE_MATCH_1}")
1009     set(component_python_version "${CMAKE_MATCH_2}")
1010   endif()
1012   set(_Boost_IMPORTED_TARGETS TRUE)
1013   if(Boost_VERSION_STRING)
1014     if(Boost_VERSION_STRING VERSION_LESS 1.33.0)
1015       message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION_STRING} (all versions older than 1.33)")
1016       set(_Boost_IMPORTED_TARGETS FALSE)
1017     elseif(Boost_VERSION_STRING VERSION_LESS 1.35.0)
1018       set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
1019       set(_Boost_REGEX_DEPENDENCIES thread)
1020       set(_Boost_WAVE_DEPENDENCIES filesystem thread)
1021       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1022     elseif(Boost_VERSION_STRING VERSION_LESS 1.36.0)
1023       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1024       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1025       set(_Boost_MPI_DEPENDENCIES serialization)
1026       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1027       set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
1028       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1029     elseif(Boost_VERSION_STRING VERSION_LESS 1.38.0)
1030       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1031       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1032       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
1033       set(_Boost_MPI_DEPENDENCIES serialization)
1034       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1035       set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
1036       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1037     elseif(Boost_VERSION_STRING VERSION_LESS 1.43.0)
1038       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1039       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1040       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
1041       set(_Boost_MPI_DEPENDENCIES serialization)
1042       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1043       set(_Boost_THREAD_DEPENDENCIES date_time)
1044       set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
1045       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1046     elseif(Boost_VERSION_STRING VERSION_LESS 1.44.0)
1047       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1048       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1049       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
1050       set(_Boost_MPI_DEPENDENCIES serialization)
1051       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1052       set(_Boost_THREAD_DEPENDENCIES date_time)
1053       set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
1054       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1055     elseif(Boost_VERSION_STRING VERSION_LESS 1.45.0)
1056       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1057       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1058       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
1059       set(_Boost_MPI_DEPENDENCIES serialization)
1060       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1061       set(_Boost_THREAD_DEPENDENCIES date_time)
1062       set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
1063       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1064     elseif(Boost_VERSION_STRING VERSION_LESS 1.47.0)
1065       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1066       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1067       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
1068       set(_Boost_MPI_DEPENDENCIES serialization)
1069       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1070       set(_Boost_THREAD_DEPENDENCIES date_time)
1071       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
1072       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1073     elseif(Boost_VERSION_STRING VERSION_LESS 1.48.0)
1074       set(_Boost_CHRONO_DEPENDENCIES system)
1075       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1076       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1077       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
1078       set(_Boost_MPI_DEPENDENCIES serialization)
1079       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1080       set(_Boost_THREAD_DEPENDENCIES date_time)
1081       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
1082       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1083     elseif(Boost_VERSION_STRING VERSION_LESS 1.50.0)
1084       set(_Boost_CHRONO_DEPENDENCIES system)
1085       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1086       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1087       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
1088       set(_Boost_MPI_DEPENDENCIES serialization)
1089       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1090       set(_Boost_THREAD_DEPENDENCIES date_time)
1091       set(_Boost_TIMER_DEPENDENCIES chrono system)
1092       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
1093       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1094     elseif(Boost_VERSION_STRING VERSION_LESS 1.53.0)
1095       set(_Boost_CHRONO_DEPENDENCIES system)
1096       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1097       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1098       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
1099       set(_Boost_MPI_DEPENDENCIES serialization)
1100       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1101       set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
1102       set(_Boost_TIMER_DEPENDENCIES chrono system)
1103       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
1104       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1105     elseif(Boost_VERSION_STRING VERSION_LESS 1.54.0)
1106       set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
1107       set(_Boost_CHRONO_DEPENDENCIES system)
1108       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1109       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1110       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
1111       set(_Boost_MPI_DEPENDENCIES serialization)
1112       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1113       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1114       set(_Boost_TIMER_DEPENDENCIES chrono system)
1115       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
1116       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1117     elseif(Boost_VERSION_STRING VERSION_LESS 1.55.0)
1118       set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
1119       set(_Boost_CHRONO_DEPENDENCIES system)
1120       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1121       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1122       set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
1123       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
1124       set(_Boost_MPI_DEPENDENCIES serialization)
1125       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1126       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1127       set(_Boost_TIMER_DEPENDENCIES chrono system)
1128       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1129       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1130     elseif(Boost_VERSION_STRING VERSION_LESS 1.56.0)
1131       set(_Boost_CHRONO_DEPENDENCIES system)
1132       set(_Boost_COROUTINE_DEPENDENCIES context system)
1133       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1134       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1135       set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
1136       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
1137       set(_Boost_MPI_DEPENDENCIES serialization)
1138       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1139       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1140       set(_Boost_TIMER_DEPENDENCIES chrono system)
1141       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1142       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1143     elseif(Boost_VERSION_STRING VERSION_LESS 1.59.0)
1144       set(_Boost_CHRONO_DEPENDENCIES system)
1145       set(_Boost_COROUTINE_DEPENDENCIES context system)
1146       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1147       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1148       set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
1149       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1150       set(_Boost_MPI_DEPENDENCIES serialization)
1151       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1152       set(_Boost_RANDOM_DEPENDENCIES system)
1153       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1154       set(_Boost_TIMER_DEPENDENCIES chrono system)
1155       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1156       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1157     elseif(Boost_VERSION_STRING VERSION_LESS 1.60.0)
1158       set(_Boost_CHRONO_DEPENDENCIES system)
1159       set(_Boost_COROUTINE_DEPENDENCIES context system)
1160       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1161       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1162       set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
1163       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1164       set(_Boost_MPI_DEPENDENCIES serialization)
1165       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1166       set(_Boost_RANDOM_DEPENDENCIES system)
1167       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1168       set(_Boost_TIMER_DEPENDENCIES chrono system)
1169       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1170       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1171     elseif(Boost_VERSION_STRING VERSION_LESS 1.61.0)
1172       set(_Boost_CHRONO_DEPENDENCIES system)
1173       set(_Boost_COROUTINE_DEPENDENCIES context system)
1174       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1175       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1176       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1177       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1178       set(_Boost_MPI_DEPENDENCIES serialization)
1179       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1180       set(_Boost_RANDOM_DEPENDENCIES system)
1181       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1182       set(_Boost_TIMER_DEPENDENCIES chrono system)
1183       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1184       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1185     elseif(Boost_VERSION_STRING VERSION_LESS 1.62.0)
1186       set(_Boost_CHRONO_DEPENDENCIES system)
1187       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1188       set(_Boost_COROUTINE_DEPENDENCIES context system)
1189       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1190       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1191       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1192       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1193       set(_Boost_MPI_DEPENDENCIES serialization)
1194       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1195       set(_Boost_RANDOM_DEPENDENCIES system)
1196       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1197       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1198       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1199     elseif(Boost_VERSION_STRING VERSION_LESS 1.63.0)
1200       set(_Boost_CHRONO_DEPENDENCIES system)
1201       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1202       set(_Boost_COROUTINE_DEPENDENCIES context system)
1203       set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
1204       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1205       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1206       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1207       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1208       set(_Boost_MPI_DEPENDENCIES serialization)
1209       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1210       set(_Boost_RANDOM_DEPENDENCIES system)
1211       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1212       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1213       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1214     elseif(Boost_VERSION_STRING VERSION_LESS 1.65.0)
1215       set(_Boost_CHRONO_DEPENDENCIES system)
1216       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1217       set(_Boost_COROUTINE_DEPENDENCIES context system)
1218       set(_Boost_COROUTINE2_DEPENDENCIES context fiber thread chrono system date_time)
1219       set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
1220       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1221       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1222       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1223       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1224       set(_Boost_MPI_DEPENDENCIES serialization)
1225       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1226       set(_Boost_RANDOM_DEPENDENCIES system)
1227       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1228       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1229       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1230     elseif(Boost_VERSION_STRING VERSION_LESS 1.67.0)
1231       set(_Boost_CHRONO_DEPENDENCIES system)
1232       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1233       set(_Boost_COROUTINE_DEPENDENCIES context system)
1234       set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
1235       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1236       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1237       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1238       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1239       set(_Boost_MPI_DEPENDENCIES serialization)
1240       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1241       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1242       set(_Boost_RANDOM_DEPENDENCIES system)
1243       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1244       set(_Boost_TIMER_DEPENDENCIES chrono system)
1245       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1246       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1247     elseif(Boost_VERSION_STRING VERSION_LESS 1.68.0)
1248       set(_Boost_CHRONO_DEPENDENCIES system)
1249       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1250       set(_Boost_COROUTINE_DEPENDENCIES context system)
1251       set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
1252       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1253       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1254       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1255       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1256       set(_Boost_MPI_DEPENDENCIES serialization)
1257       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1258       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1259       set(_Boost_RANDOM_DEPENDENCIES system)
1260       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1261       set(_Boost_TIMER_DEPENDENCIES chrono system)
1262       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1263       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1264     elseif(Boost_VERSION_STRING VERSION_LESS 1.69.0)
1265       set(_Boost_CHRONO_DEPENDENCIES system)
1266       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
1267       set(_Boost_CONTRACT_DEPENDENCIES thread chrono system date_time)
1268       set(_Boost_COROUTINE_DEPENDENCIES context system)
1269       set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
1270       set(_Boost_FILESYSTEM_DEPENDENCIES system)
1271       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1272       set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
1273       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1274       set(_Boost_MPI_DEPENDENCIES serialization)
1275       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1276       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1277       set(_Boost_RANDOM_DEPENDENCIES system)
1278       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
1279       set(_Boost_TIMER_DEPENDENCIES chrono system)
1280       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
1281       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1282     elseif(Boost_VERSION_STRING VERSION_LESS 1.70.0)
1283       set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
1284       set(_Boost_COROUTINE_DEPENDENCIES context)
1285       set(_Boost_FIBER_DEPENDENCIES context)
1286       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1287       set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
1288       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1289       set(_Boost_MPI_DEPENDENCIES serialization)
1290       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1291       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1292       set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
1293       set(_Boost_TIMER_DEPENDENCIES chrono system)
1294       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
1295       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1296     elseif(Boost_VERSION_STRING VERSION_LESS 1.72.0)
1297       set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
1298       set(_Boost_COROUTINE_DEPENDENCIES context)
1299       set(_Boost_FIBER_DEPENDENCIES context)
1300       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1301       set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
1302       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1303       set(_Boost_MPI_DEPENDENCIES serialization)
1304       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1305       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1306       set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
1307       set(_Boost_TIMER_DEPENDENCIES chrono)
1308       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
1309       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1310     elseif(Boost_VERSION_STRING VERSION_LESS 1.73.0)
1311       set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
1312       set(_Boost_COROUTINE_DEPENDENCIES context)
1313       set(_Boost_FIBER_DEPENDENCIES context)
1314       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1315       set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
1316       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l chrono atomic)
1317       set(_Boost_MPI_DEPENDENCIES serialization)
1318       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1319       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1320       set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
1321       set(_Boost_TIMER_DEPENDENCIES chrono)
1322       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
1323       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1324     elseif(Boost_VERSION_STRING VERSION_LESS 1.75.0)
1325       set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
1326       set(_Boost_COROUTINE_DEPENDENCIES context)
1327       set(_Boost_FIBER_DEPENDENCIES context)
1328       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1329       set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
1330       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1331       set(_Boost_MPI_DEPENDENCIES serialization)
1332       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1333       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1334       set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
1335       set(_Boost_TIMER_DEPENDENCIES chrono)
1336       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
1337       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1338     else()
1339       set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
1340       set(_Boost_COROUTINE_DEPENDENCIES context)
1341       set(_Boost_FIBER_DEPENDENCIES context)
1342       set(_Boost_IOSTREAMS_DEPENDENCIES regex)
1343       set(_Boost_JSON_DEPENDENCIES container)
1344       set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
1345       set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
1346       set(_Boost_MPI_DEPENDENCIES serialization)
1347       set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
1348       set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
1349       set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
1350       set(_Boost_TIMER_DEPENDENCIES chrono)
1351       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
1352       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
1353       if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.76.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
1354         message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
1355       endif()
1356     endif()
1357   endif()
1359   string(TOUPPER ${component} uppercomponent)
1360   set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
1361   set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
1363   string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
1364   if (NOT _boost_DEPS_STRING)
1365     set(_boost_DEPS_STRING "(none)")
1366   endif()
1367   # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
1368 endfunction()
1371 # Get component headers.  This is the primary header (or headers) for
1372 # a given component, and is used to check that the headers are present
1373 # as well as the library itself as an extra sanity check of the build
1374 # environment.
1376 # component - the component to check
1377 # _hdrs
1379 function(_Boost_COMPONENT_HEADERS component _hdrs)
1380   # Handle Python version suffixes
1381   if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
1382     set(component "${CMAKE_MATCH_1}")
1383     set(component_python_version "${CMAKE_MATCH_2}")
1384   endif()
1386   # Note: new boost components will require adding here.  The header
1387   # must be present in all versions of Boost providing a library.
1388   set(_Boost_ATOMIC_HEADERS              "boost/atomic.hpp")
1389   set(_Boost_CHRONO_HEADERS              "boost/chrono.hpp")
1390   set(_Boost_CONTAINER_HEADERS           "boost/container/container_fwd.hpp")
1391   set(_Boost_CONTRACT_HEADERS            "boost/contract.hpp")
1392   if(Boost_VERSION_STRING VERSION_LESS 1.61.0)
1393     set(_Boost_CONTEXT_HEADERS           "boost/context/all.hpp")
1394   else()
1395     set(_Boost_CONTEXT_HEADERS           "boost/context/detail/fcontext.hpp")
1396   endif()
1397   set(_Boost_COROUTINE_HEADERS           "boost/coroutine/all.hpp")
1398   set(_Boost_DATE_TIME_HEADERS           "boost/date_time/date.hpp")
1399   set(_Boost_EXCEPTION_HEADERS           "boost/exception/exception.hpp")
1400   set(_Boost_FIBER_HEADERS               "boost/fiber/all.hpp")
1401   set(_Boost_FILESYSTEM_HEADERS          "boost/filesystem/path.hpp")
1402   set(_Boost_GRAPH_HEADERS               "boost/graph/adjacency_list.hpp")
1403   set(_Boost_GRAPH_PARALLEL_HEADERS      "boost/graph/adjacency_list.hpp")
1404   set(_Boost_IOSTREAMS_HEADERS           "boost/iostreams/stream.hpp")
1405   set(_Boost_LOCALE_HEADERS              "boost/locale.hpp")
1406   set(_Boost_LOG_HEADERS                 "boost/log/core.hpp")
1407   set(_Boost_LOG_SETUP_HEADERS           "boost/log/detail/setup_config.hpp")
1408   set(_Boost_MATH_HEADERS                "boost/math_fwd.hpp")
1409   set(_Boost_MATH_C99_HEADERS            "boost/math/tr1.hpp")
1410   set(_Boost_MATH_C99F_HEADERS           "boost/math/tr1.hpp")
1411   set(_Boost_MATH_C99L_HEADERS           "boost/math/tr1.hpp")
1412   set(_Boost_MATH_TR1_HEADERS            "boost/math/tr1.hpp")
1413   set(_Boost_MATH_TR1F_HEADERS           "boost/math/tr1.hpp")
1414   set(_Boost_MATH_TR1L_HEADERS           "boost/math/tr1.hpp")
1415   set(_Boost_MPI_HEADERS                 "boost/mpi.hpp")
1416   set(_Boost_MPI_PYTHON_HEADERS          "boost/mpi/python/config.hpp")
1417   set(_Boost_NUMPY_HEADERS               "boost/python/numpy.hpp")
1418   set(_Boost_NOWIDE_HEADERS              "boost/nowide/cstdlib.hpp")
1419   set(_Boost_PRG_EXEC_MONITOR_HEADERS    "boost/test/prg_exec_monitor.hpp")
1420   set(_Boost_PROGRAM_OPTIONS_HEADERS     "boost/program_options.hpp")
1421   set(_Boost_PYTHON_HEADERS              "boost/python.hpp")
1422   set(_Boost_RANDOM_HEADERS              "boost/random.hpp")
1423   set(_Boost_REGEX_HEADERS               "boost/regex.hpp")
1424   set(_Boost_SERIALIZATION_HEADERS       "boost/serialization/serialization.hpp")
1425   set(_Boost_SIGNALS_HEADERS             "boost/signals.hpp")
1426   set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
1427   set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
1428   set(_Boost_STACKTRACE_BASIC_HEADERS    "boost/stacktrace.hpp")
1429   set(_Boost_STACKTRACE_NOOP_HEADERS     "boost/stacktrace.hpp")
1430   set(_Boost_STACKTRACE_WINDBG_CACHED_HEADERS "boost/stacktrace.hpp")
1431   set(_Boost_STACKTRACE_WINDBG_HEADERS   "boost/stacktrace.hpp")
1432   set(_Boost_SYSTEM_HEADERS              "boost/system/config.hpp")
1433   set(_Boost_TEST_EXEC_MONITOR_HEADERS   "boost/test/test_exec_monitor.hpp")
1434   set(_Boost_THREAD_HEADERS              "boost/thread.hpp")
1435   set(_Boost_TIMER_HEADERS               "boost/timer.hpp")
1436   set(_Boost_TYPE_ERASURE_HEADERS        "boost/type_erasure/config.hpp")
1437   set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
1438   set(_Boost_WAVE_HEADERS                "boost/wave.hpp")
1439   set(_Boost_WSERIALIZATION_HEADERS      "boost/archive/text_wiarchive.hpp")
1440   set(_Boost_BZIP2_HEADERS               "boost/iostreams/filter/bzip2.hpp")
1441   set(_Boost_ZLIB_HEADERS                "boost/iostreams/filter/zlib.hpp")
1443   string(TOUPPER ${component} uppercomponent)
1444   set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
1446   string(REGEX REPLACE ";" " " _boost_HDRS_STRING "${_Boost_${uppercomponent}_HEADERS}")
1447   if (NOT _boost_HDRS_STRING)
1448     set(_boost_HDRS_STRING "(none)")
1449   endif()
1450   # message(STATUS "Headers for Boost::${component}: ${_boost_HDRS_STRING}")
1451 endfunction()
1454 # Determine if any missing dependencies require adding to the component list.
1456 # Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
1457 # plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
1458 # defined; FALSE if dependency information is unavailable).
1460 # componentvar - the component list variable name
1461 # extravar - the indirect dependency list variable name
1464 function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
1465   # _boost_unprocessed_components - list of components requiring processing
1466   # _boost_processed_components - components already processed (or currently being processed)
1467   # _boost_new_components - new components discovered for future processing
1468   #
1469   list(APPEND _boost_unprocessed_components ${${componentvar}})
1471   while(_boost_unprocessed_components)
1472     list(APPEND _boost_processed_components ${_boost_unprocessed_components})
1473     foreach(component ${_boost_unprocessed_components})
1474       string(TOUPPER ${component} uppercomponent)
1475       set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
1476       _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
1477       set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
1478       set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
1479       foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
1480         if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components))
1481           list(APPEND _boost_new_components ${componentdep})
1482         endif()
1483       endforeach()
1484     endforeach()
1485     set(_boost_unprocessed_components ${_boost_new_components})
1486     unset(_boost_new_components)
1487   endwhile()
1488   set(_boost_extra_components ${_boost_processed_components})
1489   if(_boost_extra_components AND ${componentvar})
1490     list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
1491   endif()
1492   set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
1493   set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
1494 endfunction()
1497 # Some boost libraries may require particular set of compiler features.
1498 # The very first one was `boost::fiber` introduced in Boost 1.62.
1499 # One can check required compiler features of it in
1500 # - `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`;
1501 # - `${Boost_ROOT}/libs/context/build/Jamfile.v2`.
1503 # TODO (Re)Check compiler features on (every?) release ???
1504 # One may use the following command to get the files to check:
1506 #   $ find . -name Jamfile.v2 | grep build | xargs grep -l cxx1
1508 function(_Boost_COMPILER_FEATURES component _ret)
1509   # Boost >= 1.62
1510   if(NOT Boost_VERSION_STRING VERSION_LESS 1.62.0)
1511     set(_Boost_FIBER_COMPILER_FEATURES
1512         cxx_alias_templates
1513         cxx_auto_type
1514         cxx_constexpr
1515         cxx_defaulted_functions
1516         cxx_final
1517         cxx_lambdas
1518         cxx_noexcept
1519         cxx_nullptr
1520         cxx_rvalue_references
1521         cxx_thread_local
1522         cxx_variadic_templates
1523     )
1524     # Compiler feature for `context` same as for `fiber`.
1525     set(_Boost_CONTEXT_COMPILER_FEATURES ${_Boost_FIBER_COMPILER_FEATURES})
1526   endif()
1528   # Boost Contract library available in >= 1.67
1529   if(NOT Boost_VERSION_STRING VERSION_LESS 1.67.0)
1530     # From `libs/contract/build/boost_contract_build.jam`
1531     set(_Boost_CONTRACT_COMPILER_FEATURES
1532         cxx_lambdas
1533         cxx_variadic_templates
1534     )
1535   endif()
1537   string(TOUPPER ${component} uppercomponent)
1538   set(${_ret} ${_Boost_${uppercomponent}_COMPILER_FEATURES} PARENT_SCOPE)
1539 endfunction()
1542 # Update library search directory hint variable with paths used by prebuilt boost binaries.
1544 # Prebuilt windows binaries (https://sourceforge.net/projects/boost/files/boost-binaries/)
1545 # have library directories named using MSVC compiler version and architecture.
1546 # This function would append corresponding directories if MSVC is a current compiler,
1547 # so having `BOOST_ROOT` would be enough to specify to find everything.
1549 function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
1550   if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
1551     if(CMAKE_SIZEOF_VOID_P EQUAL 8)
1552       set(_arch_suffix 64)
1553     else()
1554       set(_arch_suffix 32)
1555     endif()
1556     if(MSVC_TOOLSET_VERSION GREATER_EQUAL 150)
1557       # Not yet known.
1558     elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 140)
1559       # MSVC toolset 14.x versions are forward compatible.
1560       foreach(v 9 8 7 6 5 4 3 2 1 0)
1561         if(MSVC_TOOLSET_VERSION GREATER_EQUAL 14${v})
1562           list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.${v})
1563         endif()
1564       endforeach()
1565     elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
1566       math(EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10")
1567       list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-${_toolset_major_version}.0)
1568     endif()
1569     set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
1570   endif()
1571 endfunction()
1574 # End functions/macros
1576 #-------------------------------------------------------------------------------
1578 #-------------------------------------------------------------------------------
1579 # main.
1580 #-------------------------------------------------------------------------------
1583 # If the user sets Boost_LIBRARY_DIR, use it as the default for both
1584 # configurations.
1585 if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR)
1586   set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}")
1587 endif()
1588 if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR)
1589   set(Boost_LIBRARY_DIR_DEBUG   "${Boost_LIBRARY_DIR}")
1590 endif()
1592 if(NOT DEFINED Boost_USE_DEBUG_LIBS)
1593   set(Boost_USE_DEBUG_LIBS TRUE)
1594 endif()
1595 if(NOT DEFINED Boost_USE_RELEASE_LIBS)
1596   set(Boost_USE_RELEASE_LIBS TRUE)
1597 endif()
1598 if(NOT DEFINED Boost_USE_MULTITHREADED)
1599   set(Boost_USE_MULTITHREADED TRUE)
1600 endif()
1601 if(NOT DEFINED Boost_USE_DEBUG_RUNTIME)
1602   set(Boost_USE_DEBUG_RUNTIME TRUE)
1603 endif()
1605 # Check the version of Boost against the requested version.
1606 if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
1607   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")
1608 endif()
1610 if(Boost_FIND_VERSION_EXACT)
1611   # The version may appear in a directory with or without the patch
1612   # level, even when the patch level is non-zero.
1613   set(_boost_TEST_VERSIONS
1614     "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
1615     "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
1616 else()
1617   # The user has not requested an exact version.  Among known
1618   # versions, find those that are acceptable to the user request.
1619   #
1620   # Note: When adding a new Boost release, also update the dependency
1621   # information in _Boost_COMPONENT_DEPENDENCIES and
1622   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
1623   # _Boost_COMPONENT_DEPENDENCIES.
1624   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
1625     "1.75.0" "1.75" "1.74.0" "1.74"
1626     "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"
1627     "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
1628     "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"
1629     "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"
1630     "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
1631     "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
1632     "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"
1633     "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"
1634     "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
1635     "1.34" "1.33.1" "1.33.0" "1.33")
1637   set(_boost_TEST_VERSIONS)
1638   if(Boost_FIND_VERSION)
1639     set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
1640     # Select acceptable versions.
1641     foreach(version ${_Boost_KNOWN_VERSIONS})
1642       if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
1643         # This version is high enough.
1644         list(APPEND _boost_TEST_VERSIONS "${version}")
1645       elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
1646         # This version is a short-form for the requested version with
1647         # the patch level dropped.
1648         list(APPEND _boost_TEST_VERSIONS "${version}")
1649       endif()
1650     endforeach()
1651   else()
1652     # Any version is acceptable.
1653     set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
1654   endif()
1655 endif()
1657 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_TEST_VERSIONS")
1658 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_MULTITHREADED")
1659 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_STATIC_LIBS")
1660 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_USE_STATIC_RUNTIME")
1661 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_ADDITIONAL_VERSIONS")
1662 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_NO_SYSTEM_PATHS")
1664 #cmake_policy(GET CMP0074 _Boost_CMP0074)
1665 if(NOT "x${_Boost_CMP0074}x" STREQUAL "xNEWx")
1666   _Boost_CHECK_SPELLING(Boost_ROOT)
1667 endif()
1668 unset(_Boost_CMP0074)
1669 _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
1670 _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
1672 # Collect environment variable inputs as hints.  Do not consider changes.
1673 foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR)
1674   set(_env $ENV{${v}})
1675   if(_env)
1676     file(TO_CMAKE_PATH "${_env}" _ENV_${v})
1677   else()
1678     set(_ENV_${v} "")
1679   endif()
1680 endforeach()
1681 if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT)
1682   set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}")
1683 endif()
1685 # Collect inputs and cached results.  Detect changes since the last run.
1686 if(NOT BOOST_ROOT AND BOOSTROOT)
1687   set(BOOST_ROOT "${BOOSTROOT}")
1688 endif()
1689 set(_Boost_VARS_DIR
1690   BOOST_ROOT
1691   Boost_NO_SYSTEM_PATHS
1692   )
1694 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_ROOT")
1695 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_ROOT" ENVIRONMENT)
1696 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_INCLUDEDIR")
1697 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_INCLUDEDIR" ENVIRONMENT)
1698 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_LIBRARYDIR")
1699 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "BOOST_LIBRARYDIR" ENVIRONMENT)
1701 # ------------------------------------------------------------------------
1702 #  Search for Boost include DIR
1703 # ------------------------------------------------------------------------
1705 set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS)
1706 _Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC})
1707 # Clear Boost_INCLUDE_DIR if it did not change but other input affecting the
1708 # location did.  We will find a new one based on the new inputs.
1709 if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED)
1710   unset(Boost_INCLUDE_DIR CACHE)
1711 endif()
1713 if(NOT Boost_INCLUDE_DIR)
1714   set(_boost_INCLUDE_SEARCH_DIRS "")
1715   if(BOOST_INCLUDEDIR)
1716     list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR})
1717   elseif(_ENV_BOOST_INCLUDEDIR)
1718     list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR})
1719   endif()
1721   if( BOOST_ROOT )
1722     list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT})
1723   elseif( _ENV_BOOST_ROOT )
1724     list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT})
1725   endif()
1727   if( Boost_NO_SYSTEM_PATHS)
1728     list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
1729   else()
1730     if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
1731       foreach(ver ${_boost_TEST_VERSIONS})
1732         string(REPLACE "." "_" ver "${ver}")
1733         list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
1734       endforeach()
1735     endif()
1736     list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS
1737       C:/boost/include
1738       C:/boost
1739       /sw/local/include
1740       )
1741   endif()
1743   # Try to find Boost by stepping backwards through the Boost versions
1744   # we know about.
1745   # Build a list of path suffixes for each version.
1746   set(_boost_PATH_SUFFIXES)
1747   foreach(_boost_VER ${_boost_TEST_VERSIONS})
1748     # Add in a path suffix, based on the required version, ideally
1749     # we could read this from version.hpp, but for that to work we'd
1750     # need to know the include dir already
1751     set(_boost_BOOSTIFIED_VERSION)
1753     # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
1754     if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
1755         set(_boost_BOOSTIFIED_VERSION
1756           "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}")
1757     elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)")
1758         set(_boost_BOOSTIFIED_VERSION
1759           "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
1760     endif()
1762     list(APPEND _boost_PATH_SUFFIXES
1763       "boost-${_boost_BOOSTIFIED_VERSION}"
1764       "boost_${_boost_BOOSTIFIED_VERSION}"
1765       "boost/boost-${_boost_BOOSTIFIED_VERSION}"
1766       "boost/boost_${_boost_BOOSTIFIED_VERSION}"
1767       )
1769   endforeach()
1771   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_INCLUDE_SEARCH_DIRS")
1772   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_PATH_SUFFIXES")
1774   # Look for a standard boost header file.
1775   find_path(Boost_INCLUDE_DIR
1776     NAMES         boost/config.hpp
1777     HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
1778     PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
1779     )
1780 endif()
1782 # ------------------------------------------------------------------------
1783 #  Extract version information from version.hpp
1784 # ------------------------------------------------------------------------
1786 if(Boost_INCLUDE_DIR)
1787   _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
1788                      "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
1790   # Extract Boost_VERSION_MACRO and Boost_LIB_VERSION from version.hpp
1791   set(Boost_VERSION_MACRO 0)
1792   set(Boost_LIB_VERSION "")
1793   file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
1794   if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_VERSION ([0-9]+)")
1795     set(Boost_VERSION_MACRO "${CMAKE_MATCH_1}")
1796   endif()
1797   if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
1798     set(Boost_LIB_VERSION "${CMAKE_MATCH_1}")
1799   endif()
1800   unset(_boost_VERSION_HPP_CONTENTS)
1802   # Calculate version components
1803   math(EXPR Boost_VERSION_MAJOR "${Boost_VERSION_MACRO} / 100000")
1804   math(EXPR Boost_VERSION_MINOR "${Boost_VERSION_MACRO} / 100 % 1000")
1805   math(EXPR Boost_VERSION_PATCH "${Boost_VERSION_MACRO} % 100")
1806   set(Boost_VERSION_COUNT 3)
1808   # Define alias variables for backwards compat.
1809   set(Boost_MAJOR_VERSION ${Boost_VERSION_MAJOR})
1810   set(Boost_MINOR_VERSION ${Boost_VERSION_MINOR})
1811   set(Boost_SUBMINOR_VERSION ${Boost_VERSION_PATCH})
1813   # Define Boost version in x.y.z format
1814   set(Boost_VERSION_STRING "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")
1816   # Define final Boost_VERSION
1817   #cmake_policy(GET CMP0093 _Boost_CMP0093
1818   #  PARENT_SCOPE # undocumented, do not use outside of CMake
1819   #)
1820   if("x${_Boost_CMP0093}x" STREQUAL "xNEWx")
1821     set(Boost_VERSION ${Boost_VERSION_STRING})
1822   else()
1823     set(Boost_VERSION ${Boost_VERSION_MACRO})
1824   endif()
1825   unset(_Boost_CMP0093)
1827   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION")
1828   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_STRING")
1829   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MACRO")
1830   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MAJOR")
1831   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_MINOR")
1832   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_PATCH")
1833   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_VERSION_COUNT")
1834 endif()
1836 # ------------------------------------------------------------------------
1837 #  Prefix initialization
1838 # ------------------------------------------------------------------------
1840 if ( NOT DEFINED Boost_LIB_PREFIX )
1841   # Boost's static libraries use a "lib" prefix on DLL platforms
1842   # to distinguish them from the DLL import libraries.
1843   if (Boost_USE_STATIC_LIBS AND (
1844       (WIN32 AND NOT CYGWIN)
1845       OR GHSMULTI
1846       ))
1847     set(Boost_LIB_PREFIX "lib")
1848   else()
1849     set(Boost_LIB_PREFIX "")
1850   endif()
1851 endif()
1853 if ( NOT Boost_NAMESPACE )
1854   set(Boost_NAMESPACE "boost")
1855 endif()
1857 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_LIB_PREFIX")
1858 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "Boost_NAMESPACE")
1860 # ------------------------------------------------------------------------
1861 #  Suffix initialization and compiler suffix detection.
1862 # ------------------------------------------------------------------------
1864 set(_Boost_VARS_NAME
1865   Boost_NAMESPACE
1866   Boost_COMPILER
1867   Boost_THREADAPI
1868   Boost_USE_DEBUG_PYTHON
1869   Boost_USE_MULTITHREADED
1870   Boost_USE_STATIC_LIBS
1871   Boost_USE_STATIC_RUNTIME
1872   Boost_USE_STLPORT
1873   Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
1874   )
1875 _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME})
1877 # Setting some more suffixes for the library
1878 if (Boost_COMPILER)
1879   set(_boost_COMPILER ${Boost_COMPILER})
1880   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
1881                          "_boost_COMPILER" SOURCE "user-specified via Boost_COMPILER")
1882 else()
1883   # Attempt to guess the compiler suffix
1884   # NOTE: this is not perfect yet, if you experience any issues
1885   # please report them and use the Boost_COMPILER variable
1886   # to work around the problems.
1887   _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER)
1888 endif()
1890 set (_boost_MULTITHREADED "-mt")
1891 if( NOT Boost_USE_MULTITHREADED )
1892   set (_boost_MULTITHREADED "")
1893 endif()
1894 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_MULTITHREADED")
1896 #======================
1897 # Systematically build up the Boost ABI tag for the 'tagged' and 'versioned' layouts
1898 # http://boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming
1899 # http://boost.org/doc/libs/1_66_0/boost/config/auto_link.hpp
1900 # http://boost.org/doc/libs/1_66_0/tools/build/src/tools/common.jam
1901 # http://boost.org/doc/libs/1_66_0/boostcpp.jam
1902 set( _boost_RELEASE_ABI_TAG "-")
1903 set( _boost_DEBUG_ABI_TAG   "-")
1904 # Key       Use this library when:
1905 #  s        linking statically to the C++ standard library and
1906 #           compiler runtime support libraries.
1907 if(Boost_USE_STATIC_RUNTIME)
1908   set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
1909   set( _boost_DEBUG_ABI_TAG   "${_boost_DEBUG_ABI_TAG}s")
1910 endif()
1911 #  g        using debug versions of the standard and runtime
1912 #           support libraries
1913 if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
1914   if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
1915           OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang"
1916           OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel"
1917           OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntelLLVM")
1918     string(APPEND _boost_DEBUG_ABI_TAG "g")
1919   endif()
1920 endif()
1921 #  y        using special debug build of python
1922 if(Boost_USE_DEBUG_PYTHON)
1923   string(APPEND _boost_DEBUG_ABI_TAG "y")
1924 endif()
1925 #  d        using a debug version of your code
1926 string(APPEND _boost_DEBUG_ABI_TAG "d")
1927 #  p        using the STLport standard library rather than the
1928 #           default one supplied with your compiler
1929 if(Boost_USE_STLPORT)
1930   string(APPEND _boost_RELEASE_ABI_TAG "p")
1931   string(APPEND _boost_DEBUG_ABI_TAG "p")
1932 endif()
1933 #  n        using the STLport deprecated "native iostreams" feature
1934 #           removed from the documentation in 1.43.0 but still present in
1935 #           boost/config/auto_link.hpp
1936 if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
1937   string(APPEND _boost_RELEASE_ABI_TAG "n")
1938   string(APPEND _boost_DEBUG_ABI_TAG "n")
1939 endif()
1941 #  -x86     Architecture and address model tag
1942 #           First character is the architecture, then word-size, either 32 or 64
1943 #           Only used in 'versioned' layout, added in Boost 1.66.0
1944 if(DEFINED Boost_ARCHITECTURE)
1945   set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}")
1946   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
1947                          "_boost_ARCHITECTURE_TAG" SOURCE "user-specified via Boost_ARCHITECTURE")
1948 else()
1949   set(_boost_ARCHITECTURE_TAG "")
1950   # {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
1951   if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION_STRING VERSION_LESS 1.66.0)
1952     string(APPEND _boost_ARCHITECTURE_TAG "-")
1953     # This needs to be kept in-sync with the section of CMakePlatformId.h.in
1954     # inside 'defined(_WIN32) && defined(_MSC_VER)'
1955     if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
1956       string(APPEND _boost_ARCHITECTURE_TAG "i")
1957     elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
1958               OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
1959       string(APPEND _boost_ARCHITECTURE_TAG "x")
1960     elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
1961       string(APPEND _boost_ARCHITECTURE_TAG "a")
1962     elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
1963       string(APPEND _boost_ARCHITECTURE_TAG "m")
1964     endif()
1966     if(CMAKE_SIZEOF_VOID_P EQUAL 8)
1967       string(APPEND _boost_ARCHITECTURE_TAG "64")
1968     else()
1969       string(APPEND _boost_ARCHITECTURE_TAG "32")
1970     endif()
1971   endif()
1972   _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
1973                          "_boost_ARCHITECTURE_TAG" SOURCE "detected")
1974 endif()
1976 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_RELEASE_ABI_TAG")
1977 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_DEBUG_ABI_TAG")
1979 # ------------------------------------------------------------------------
1980 #  Begin finding boost libraries
1981 # ------------------------------------------------------------------------
1983 set(_Boost_VARS_LIB "")
1984 foreach(c DEBUG RELEASE)
1985   set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c})
1986   list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}})
1987   _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR)
1988   # Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the
1989   # location did.  We will find a new one based on the new inputs.
1990   if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED)
1991     unset(Boost_LIBRARY_DIR_${c} CACHE)
1992   endif()
1994   # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value.
1995   if(Boost_LIBRARY_DIR_${c})
1996     set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
1997   else()
1998     set(_boost_LIBRARY_SEARCH_DIRS_${c} "")
1999     if(BOOST_LIBRARYDIR)
2000       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR})
2001     elseif(_ENV_BOOST_LIBRARYDIR)
2002       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR})
2003     endif()
2005     if(BOOST_ROOT)
2006       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib)
2007       _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${BOOST_ROOT}")
2008     elseif(_ENV_BOOST_ROOT)
2009       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib)
2010       _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${_ENV_BOOST_ROOT}")
2011     endif()
2013     list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c}
2014       ${Boost_INCLUDE_DIR}/lib
2015       ${Boost_INCLUDE_DIR}/../lib
2016       ${Boost_INCLUDE_DIR}/stage/lib
2017       )
2018     _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}/..")
2019     _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}")
2020     if( Boost_NO_SYSTEM_PATHS )
2021       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
2022     else()
2023       foreach(ver ${_boost_TEST_VERSIONS})
2024         string(REPLACE "." "_" ver "${ver}")
2025         _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
2026       endforeach()
2027       _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/boost")
2028       list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS
2029         C:/boost/lib
2030         C:/boost
2031         /sw/local/lib
2032         )
2033     endif()
2034   endif()
2035 endforeach()
2037 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_LIBRARY_SEARCH_DIRS_RELEASE")
2038 _Boost_DEBUG_PRINT_VAR("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}" "_boost_LIBRARY_SEARCH_DIRS_DEBUG")
2040 # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
2041 if( Boost_USE_STATIC_LIBS )
2042   set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
2043   if(WIN32)
2044     list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)
2045   else()
2046     set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
2047   endif()
2048 endif()
2050 # We want to use the tag inline below without risking double dashes
2051 if(_boost_RELEASE_ABI_TAG)
2052   if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
2053     set(_boost_RELEASE_ABI_TAG "")
2054   endif()
2055 endif()
2056 if(_boost_DEBUG_ABI_TAG)
2057   if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
2058     set(_boost_DEBUG_ABI_TAG "")
2059   endif()
2060 endif()
2062 # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
2063 # on WIN32 was to:
2064 #  1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
2065 #  2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
2066 # We maintain this behavior since changing it could break people's builds.
2067 # To disable the ambiguous behavior, the user need only
2068 # set Boost_USE_STATIC_RUNTIME either ON or OFF.
2069 set(_boost_STATIC_RUNTIME_WORKAROUND false)
2070 if(WIN32 AND Boost_USE_STATIC_LIBS)
2071   if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
2072     set(_boost_STATIC_RUNTIME_WORKAROUND TRUE)
2073   endif()
2074 endif()
2076 # On versions < 1.35, remove the System library from the considered list
2077 # since it wasn't added until 1.35.
2078 if(Boost_VERSION_STRING AND Boost_FIND_COMPONENTS)
2079   if(Boost_VERSION_STRING VERSION_LESS 1.35.0)
2080     list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
2081   endif()
2082 endif()
2084 # Additional components may be required via component dependencies.
2085 # Add any missing components to the list.
2086 _Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
2088 # If thread is required, get the thread libs as a dependency
2089 if("thread" IN_LIST Boost_FIND_COMPONENTS)
2090   if(Boost_FIND_QUIETLY)
2091     set(_Boost_find_quiet QUIET)
2092   else()
2093     set(_Boost_find_quiet "")
2094   endif()
2095   find_package(Threads ${_Boost_find_quiet})
2096   unset(_Boost_find_quiet)
2097 endif()
2099 # If the user changed any of our control inputs flush previous results.
2100 if(_Boost_CHANGE_LIBDIR_DEBUG OR _Boost_CHANGE_LIBDIR_RELEASE OR _Boost_CHANGE_LIBNAME)
2101   foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
2102     string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
2103     foreach(c DEBUG RELEASE)
2104       set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c})
2105       unset(${_var} CACHE)
2106       set(${_var} "${_var}-NOTFOUND")
2107     endforeach()
2108   endforeach()
2109   set(_Boost_COMPONENTS_SEARCHED "")
2110 endif()
2112 foreach(COMPONENT ${Boost_FIND_COMPONENTS})
2113   string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
2115   set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
2116   set( _boost_docstring_debug   "Boost ${COMPONENT} library (debug)")
2118   # Compute component-specific hints.
2119   set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
2120   if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
2121      ${COMPONENT} STREQUAL "graph_parallel")
2122     foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
2123       if(IS_ABSOLUTE "${lib}")
2124         get_filename_component(libdir "${lib}" PATH)
2125         string(REPLACE "\\" "/" libdir "${libdir}")
2126         list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir})
2127       endif()
2128     endforeach()
2129   endif()
2131   # Handle Python version suffixes
2132   unset(COMPONENT_PYTHON_VERSION_MAJOR)
2133   unset(COMPONENT_PYTHON_VERSION_MINOR)
2134   if(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\$")
2135     set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
2136     set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
2137   elseif(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\\.?([0-9])\$")
2138     set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
2139     set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
2140     set(COMPONENT_PYTHON_VERSION_MINOR "${CMAKE_MATCH_3}")
2141   endif()
2143   unset(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
2144   if (COMPONENT_PYTHON_VERSION_MINOR)
2145     # Boost >= 1.67
2146     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
2147     # Debian/Ubuntu (Some versions omit the 2 and/or 3 from the suffix)
2148     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
2149     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
2150     # Gentoo
2151     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}.${COMPONENT_PYTHON_VERSION_MINOR}")
2152     # RPMs
2153     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
2154   endif()
2155   if (COMPONENT_PYTHON_VERSION_MAJOR AND NOT COMPONENT_PYTHON_VERSION_MINOR)
2156     # Boost < 1.67
2157     list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}")
2158   endif()
2160   # Consolidate and report component-specific hints.
2161   if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
2162     list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
2163     _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
2164       "Component-specific library search names for ${COMPONENT_NAME}: ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME}")
2165   endif()
2166   if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
2167     list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
2168     _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
2169       "Component-specific library search paths for ${COMPONENT}: ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}")
2170   endif()
2172   #
2173   # Find headers
2174   #
2175   _Boost_COMPONENT_HEADERS("${COMPONENT}" Boost_${UPPERCOMPONENT}_HEADER_NAME)
2176   # Look for a standard boost header file.
2177   if(Boost_${UPPERCOMPONENT}_HEADER_NAME)
2178     if(EXISTS "${Boost_INCLUDE_DIR}/${Boost_${UPPERCOMPONENT}_HEADER_NAME}")
2179       set(Boost_${UPPERCOMPONENT}_HEADER ON)
2180     else()
2181       set(Boost_${UPPERCOMPONENT}_HEADER OFF)
2182     endif()
2183   else()
2184     set(Boost_${UPPERCOMPONENT}_HEADER ON)
2185     message(WARNING "No header defined for ${COMPONENT}; skipping header check "
2186                     "(note: header-only libraries have no designated component)")
2187   endif()
2189   #
2190   # Find RELEASE libraries
2191   #
2192   unset(_boost_RELEASE_NAMES)
2193   foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
2194     foreach(compiler IN LISTS _boost_COMPILER)
2195       list(APPEND _boost_RELEASE_NAMES
2196         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2197         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2198         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
2199     endforeach()
2200     list(APPEND _boost_RELEASE_NAMES
2201       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2202       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2203       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
2204       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
2205       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
2206     if(_boost_STATIC_RUNTIME_WORKAROUND)
2207       set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
2208       foreach(compiler IN LISTS _boost_COMPILER)
2209         list(APPEND _boost_RELEASE_NAMES
2210           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2211           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2212           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
2213       endforeach()
2214       list(APPEND _boost_RELEASE_NAMES
2215         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2216         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2217         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
2218     endif()
2219   endforeach()
2220   if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
2221     _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
2222   endif()
2223   _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
2224                      "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
2226   # if Boost_LIBRARY_DIR_RELEASE is not defined,
2227   # but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs
2228   if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG)
2229     list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG})
2230   endif()
2232   # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
2233   string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}")
2235   if(Boost_USE_RELEASE_LIBS)
2236     _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE
2237       NAMES ${_boost_RELEASE_NAMES}
2238       HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
2239       NAMES_PER_DIR
2240       DOC "${_boost_docstring_release}"
2241       )
2242   endif()
2244   #
2245   # Find DEBUG libraries
2246   #
2247   unset(_boost_DEBUG_NAMES)
2248   foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
2249     foreach(compiler IN LISTS _boost_COMPILER)
2250       list(APPEND _boost_DEBUG_NAMES
2251         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2252         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2253         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
2254     endforeach()
2255     list(APPEND _boost_DEBUG_NAMES
2256       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2257       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2258       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
2259       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
2260       ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
2261     if(_boost_STATIC_RUNTIME_WORKAROUND)
2262       set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
2263       foreach(compiler IN LISTS _boost_COMPILER)
2264         list(APPEND _boost_DEBUG_NAMES
2265           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2266           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2267           ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
2268       endforeach()
2269       list(APPEND _boost_DEBUG_NAMES
2270         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
2271         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
2272         ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
2273     endif()
2274   endforeach()
2275   if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
2276      _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
2277   endif()
2278   _Boost_DEBUG_PRINT("${CMAKE_CURRENT_LIST_FILE}" "${CMAKE_CURRENT_LIST_LINE}"
2279                      "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
2281   # if Boost_LIBRARY_DIR_DEBUG is not defined,
2282   # but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs
2283   if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE)
2284     list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE})
2285   endif()
2287   # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
2288   string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
2290   if(Boost_USE_DEBUG_LIBS)
2291     _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG
2292       NAMES ${_boost_DEBUG_NAMES}
2293       HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
2294       NAMES_PER_DIR
2295       DOC "${_boost_docstring_debug}"
2296       )
2297   endif ()
2299   if(Boost_REALPATH)
2300     _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
2301     _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG   "${_boost_docstring_debug}"  )
2302   endif()
2304   _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
2306   # Check if component requires some compiler features
2307   _Boost_COMPILER_FEATURES(${COMPONENT} _Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
2309 endforeach()
2311 # Restore the original find library ordering
2312 if( Boost_USE_STATIC_LIBS )
2313   set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
2314 endif()
2316 # ------------------------------------------------------------------------
2317 #  End finding boost libraries
2318 # ------------------------------------------------------------------------
2320 set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
2321 set(Boost_LIBRARY_DIRS)
2322 if(Boost_LIBRARY_DIR_RELEASE)
2323   list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE})
2324 endif()
2325 if(Boost_LIBRARY_DIR_DEBUG)
2326   list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG})
2327 endif()
2328 if(Boost_LIBRARY_DIRS)
2329   list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
2330 endif()
2332 # ------------------------------------------------------------------------
2333 #  Call FPHSA helper, see https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html
2334 # ------------------------------------------------------------------------
2336 # Define aliases as needed by the component handler in the FPHSA helper below
2337 foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
2338   string(TOUPPER ${_comp} _uppercomp)
2339   if(DEFINED Boost_${_uppercomp}_FOUND)
2340     set(Boost_${_comp}_FOUND ${Boost_${_uppercomp}_FOUND})
2341   endif()
2342 endforeach()
2344 find_package_handle_standard_args(Boost
2345   REQUIRED_VARS Boost_INCLUDE_DIR
2346   VERSION_VAR Boost_VERSION_STRING
2347   HANDLE_COMPONENTS)
2349 if(Boost_FOUND)
2350   if( NOT Boost_LIBRARY_DIRS )
2351     # Compatibility Code for backwards compatibility with CMake
2352     # 2.4's FindBoost module.
2354     # Look for the boost library path.
2355     # Note that the user may not have installed any libraries
2356     # so it is quite possible the Boost_LIBRARY_DIRS may not exist.
2357     set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
2359     if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
2360       get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
2361     endif()
2363     if("${_boost_LIB_DIR}" MATCHES "/include$")
2364       # Strip off the trailing "/include" in the path.
2365       get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
2366     endif()
2368     if(EXISTS "${_boost_LIB_DIR}/lib")
2369       string(APPEND _boost_LIB_DIR /lib)
2370     elseif(EXISTS "${_boost_LIB_DIR}/stage/lib")
2371       string(APPEND _boost_LIB_DIR "/stage/lib")
2372     else()
2373       set(_boost_LIB_DIR "")
2374     endif()
2376     if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
2377       set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR})
2378     endif()
2380   endif()
2381 else()
2382   # Boost headers were not found so no components were found.
2383   foreach(COMPONENT ${Boost_FIND_COMPONENTS})
2384     string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
2385     set(Boost_${UPPERCOMPONENT}_FOUND 0)
2386   endforeach()
2387 endif()
2389 # ------------------------------------------------------------------------
2390 #  Add imported targets
2391 # ------------------------------------------------------------------------
2393 if(Boost_FOUND)
2394   # The builtin CMake package in Boost 1.70+ introduces a new name
2395   # for the header-only lib, let's provide the same UI in module mode
2396   if(NOT TARGET Boost::headers)
2397     add_library(Boost::headers INTERFACE IMPORTED)
2398     if(Boost_INCLUDE_DIRS)
2399       set_target_properties(Boost::headers PROPERTIES
2400         INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
2401     endif()
2402   endif()
2404   # Define the old target name for header-only libraries for backwards
2405   # compat.
2406   if(NOT TARGET Boost::boost)
2407     add_library(Boost::boost INTERFACE IMPORTED)
2408     set_target_properties(Boost::boost
2409       PROPERTIES INTERFACE_LINK_LIBRARIES Boost::headers)
2410   endif()
2412   foreach(COMPONENT ${Boost_FIND_COMPONENTS})
2413     if(_Boost_IMPORTED_TARGETS AND NOT TARGET Boost::${COMPONENT})
2414       string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
2415       if(Boost_${UPPERCOMPONENT}_FOUND)
2416         if(Boost_USE_STATIC_LIBS)
2417           add_library(Boost::${COMPONENT} STATIC IMPORTED)
2418         else()
2419           # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
2420           # libraries as a result.
2421           add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
2422         endif()
2423         if(Boost_INCLUDE_DIRS)
2424           set_target_properties(Boost::${COMPONENT} PROPERTIES
2425             INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
2426         endif()
2427         if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
2428           set_target_properties(Boost::${COMPONENT} PROPERTIES
2429             IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
2430             IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
2431         endif()
2432         if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
2433           set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
2434             IMPORTED_CONFIGURATIONS RELEASE)
2435           set_target_properties(Boost::${COMPONENT} PROPERTIES
2436             IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
2437             IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
2438         endif()
2439         if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
2440           set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
2441             IMPORTED_CONFIGURATIONS DEBUG)
2442           set_target_properties(Boost::${COMPONENT} PROPERTIES
2443             IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
2444             IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
2445         endif()
2446         if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
2447           unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
2448           foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
2449             list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
2450           endforeach()
2451           if(COMPONENT STREQUAL "thread")
2452             list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
2453           endif()
2454           set_target_properties(Boost::${COMPONENT} PROPERTIES
2455             INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
2456         endif()
2457         if(_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
2458           set_target_properties(Boost::${COMPONENT} PROPERTIES
2459             INTERFACE_COMPILE_FEATURES "${_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES}")
2460         endif()
2461       endif()
2462     endif()
2463   endforeach()
2465   # Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
2466   # will only contain any interface definitions on WIN32, but is created
2467   # on all platforms to keep end user code free from platform dependent
2468   # code.  Also provide convenience targets to disable autolinking and
2469   # enable dynamic linking.
2470   if(NOT TARGET Boost::diagnostic_definitions)
2471     add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
2472     add_library(Boost::disable_autolinking INTERFACE IMPORTED)
2473     add_library(Boost::dynamic_linking INTERFACE IMPORTED)
2474     set_target_properties(Boost::dynamic_linking PROPERTIES
2475       INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
2476   endif()
2477   if(WIN32)
2478     # In windows, automatic linking is performed, so you do not have
2479     # to specify the libraries.  If you are linking to a dynamic
2480     # runtime, then you can choose to link to either a static or a
2481     # dynamic Boost library, the default is to do a static link.  You
2482     # can alter this for a specific library "whatever" by defining
2483     # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
2484     # linked dynamically.  Alternatively you can force all Boost
2485     # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
2487     # This feature can be disabled for Boost library "whatever" by
2488     # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
2489     # BOOST_ALL_NO_LIB.
2491     # If you want to observe which libraries are being linked against
2492     # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
2493     # code to emit a #pragma message each time a library is selected
2494     # for linking.
2495     set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
2496     set_target_properties(Boost::diagnostic_definitions PROPERTIES
2497       INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
2498     set_target_properties(Boost::disable_autolinking PROPERTIES
2499       INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
2500   endif()
2501 endif()
2503 # ------------------------------------------------------------------------
2504 #  Finalize
2505 # ------------------------------------------------------------------------
2507 # Report Boost_LIBRARIES
2508 set(Boost_LIBRARIES "")
2509 foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
2510   string(TOUPPER ${_comp} _uppercomp)
2511   if(Boost_${_uppercomp}_FOUND)
2512     list(APPEND Boost_LIBRARIES ${Boost_${_uppercomp}_LIBRARY})
2513     if(_comp STREQUAL "thread")
2514       list(APPEND Boost_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
2515     endif()
2516   endif()
2517 endforeach()
2519 # Configure display of cache entries in GUI.
2520 foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB})
2521   get_property(_type CACHE ${v} PROPERTY TYPE)
2522   if(_type)
2523     set_property(CACHE ${v} PROPERTY ADVANCED 1)
2524     if("x${_type}" STREQUAL "xUNINITIALIZED")
2525       if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS")
2526         set_property(CACHE ${v} PROPERTY TYPE STRING)
2527       else()
2528         set_property(CACHE ${v} PROPERTY TYPE PATH)
2529       endif()
2530     endif()
2531   endif()
2532 endforeach()
2534 # Record last used values of input variables so we can
2535 # detect on the next run if the user changed them.
2536 foreach(v
2537     ${_Boost_VARS_INC} ${_Boost_VARS_LIB}
2538     ${_Boost_VARS_DIR} ${_Boost_VARS_NAME}
2539     )
2540   if(DEFINED ${v})
2541     set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.")
2542   else()
2543     unset(_${v}_LAST CACHE)
2544   endif()
2545 endforeach()
2547 # Maintain a persistent list of components requested anywhere since
2548 # the last flush.
2549 set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}")
2550 list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS})
2551 list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED)
2552 list(SORT _Boost_COMPONENTS_SEARCHED)
2553 set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}"
2554   CACHE INTERNAL "Components requested for this build tree.")
2556 # Restore project's policies
2557 cmake_policy(POP)