# - Create imported targets for Boost libraries
#
# This script is intended to supplement versions of CMake below 3.5, where those
# targets are not defined.
#
# Modified from CMake 3.5.2 FindBoost.cmake by Leo Koppel <lkoppel@uwaterloo.ca>
#
# Updated _Boost_COMPONENT_DEPENDENCIES from CMake 3.10.0 to allow some newer
# Boost / older CMake combinations as well (e.g. Boost 1.63 with CMake 3.5).
# This case is mostly untested.
#
#
#=============================================================================
# Copyright 2006-2012 Kitware, Inc.
# Copyright 2006-2008 Andreas Schneider <mail@cynapses.org>
# Copyright 2007      Wengo
# Copyright 2007      Mike Jackson
# Copyright 2008      Andreas Pakulat <apaku@gmx.de>
# Copyright 2008-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# included below or see https://cmake.org/licensing/ for details.
#
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2016 Kitware, Inc.
# Copyright 2000-2011 Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#-------------------------------------------------------------------------------

if(NOT Boost_FOUND)
    return()
endif()
if(TARGET Boost::boost)
    # This script is not needed as imported targets already exist
    return()
endif()

#-------------------------------------------------------------------------------
#  FindBoost functions & macros

# (snip)

# Get component dependencies.  Requires the dependencies to have been
# defined for the Boost release version.
#
# component - the component to check
# _ret - list of library dependencies
#
function(_Boost_COMPONENT_DEPENDENCIES component _ret)
    # Note: to add a new Boost release, run
    #
    #   % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
    #
    # The output may be added in a new block below.  If it's the same as
    # the previous release, simply update the version range of the block
    # for the previous release.
    #
    # This information was originally generated by running
    # BoostScanDeps.cmake against every boost release to date supported
    # by FindBoost:
    #
    #   % for version in /path/to/boost/sources/*
    #     do
    #       cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
    #     done
    #
    # The output was then updated by search and replace with these regexes:
    #
    # - Strip message(STATUS) prefix dashes
    #   s;^-- ;;
    # - Indent
    #   s;^set(;    set(;;
    # - Add conditionals
    #   s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*);  elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx);
    #
    # This results in the logic seen below, but will require the xxxx
    # replacing with the following Boost release version (or the next
    # minor version to be released, e.g. 1.59 was the latest at the time
    # of writing, making 1.60 the next, so 106000 is the needed version
    # number).  Identical consecutive releases were then merged together
    # by updating the end range of the first block and removing the
    # following redundant blocks.
    #
    # Running the script against all historical releases should be
    # required only if the BoostScanDeps.cmake script logic is changed.
    # The addition of a new release should only require it to be run
    # against the new release.
    set(_Boost_IMPORTED_TARGETS TRUE)
    if(Boost_VERSION VERSION_LESS 103300)
        message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
        set(_Boost_IMPORTED_TARGETS FALSE)
    elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
        set(_Boost_REGEX_DEPENDENCIES thread)
        set(_Boost_WAVE_DEPENDENCIES filesystem thread)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES date_time)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400)
        set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500)
        set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 106000 AND Boost_VERSION VERSION_LESS 106100)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_TIMER_DEPENDENCIES chrono system)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 106100 AND Boost_VERSION VERSION_LESS 106200)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106300)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    elseif(NOT Boost_VERSION VERSION_LESS 106300 AND Boost_VERSION VERSION_LESS 106500)
        set(_Boost_CHRONO_DEPENDENCIES system)
        set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
        set(_Boost_COROUTINE_DEPENDENCIES context system)
        set(_Boost_COROUTINE2_DEPENDENCIES context fiber thread chrono system date_time)
        set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
        set(_Boost_FILESYSTEM_DEPENDENCIES system)
        set(_Boost_IOSTREAMS_DEPENDENCIES regex)
        set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
        set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
        set(_Boost_MPI_DEPENDENCIES serialization)
        set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
        set(_Boost_RANDOM_DEPENDENCIES system)
        set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
        set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
        set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
    else()
        if(NOT Boost_VERSION VERSION_LESS 106500)
            set(_Boost_CHRONO_DEPENDENCIES system)
            set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
            set(_Boost_COROUTINE_DEPENDENCIES context system)
            set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
            set(_Boost_FILESYSTEM_DEPENDENCIES system)
            set(_Boost_IOSTREAMS_DEPENDENCIES regex)
            set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
            set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
            set(_Boost_MPI_DEPENDENCIES serialization)
            set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
            set(_Boost_NUMPY_DEPENDENCIES python)
            set(_Boost_RANDOM_DEPENDENCIES system)
            set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
            set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
            set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
        endif()
        if(NOT Boost_VERSION VERSION_LESS 106600)
            message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
            set(_Boost_IMPORTED_TARGETS FALSE)
        endif()
    endif()

    string(TOUPPER ${component} uppercomponent)
    set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
    set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)

    string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
    if (NOT _boost_DEPS_STRING)
        set(_boost_DEPS_STRING "(none)")
    endif()
    # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
endfunction()

#
# Determine if any missing dependencies require adding to the component list.
#
# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
# plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
# defined; FALSE if dependency information is unavailable).
#
# componentvar - the component list variable name
# extravar - the indirect dependency list variable name
#
#
function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
    # _boost_unprocessed_components - list of components requiring processing
    # _boost_processed_components - components already processed (or currently being processed)
    # _boost_new_components - new components discovered for future processing
    #
    list(APPEND _boost_unprocessed_components ${${componentvar}})

    while(_boost_unprocessed_components)
        list(APPEND _boost_processed_components ${_boost_unprocessed_components})
        foreach(component ${_boost_unprocessed_components})
            string(TOUPPER ${component} uppercomponent)
            set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
            _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
            set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
            set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
            foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
                list(FIND _boost_processed_components "${componentdep}" _boost_component_found)
                list(FIND _boost_new_components "${componentdep}" _boost_component_new)
                if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1)
                    list(APPEND _boost_new_components ${componentdep})
                endif()
            endforeach()
        endforeach()
        set(_boost_unprocessed_components ${_boost_new_components})
        unset(_boost_new_components)
    endwhile()
    set(_boost_extra_components ${_boost_processed_components})
    if(_boost_extra_components AND ${componentvar})
        list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
    endif()
    set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
    set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
endfunction()

#
# End functions/macros
#
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# main.
#-------------------------------------------------------------------------------

# (snip)

# Additional components may be required via component dependencies.
# Add any missing components to the list.
_Boost_MISSING_DEPENDENCIES(_Boost_COMPONENTS_SEARCHED _Boost_EXTRA_FIND_COMPONENTS)

# If thread is required, get the thread libs as a dependency
list(FIND _Boost_COMPONENTS_SEARCHED thread _Boost_THREAD_DEPENDENCY_LIBS)
if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1)
    include(CMakeFindDependencyMacro)
    find_dependency(Threads)
endif()

# snip

# ------------------------------------------------------------------------
#  Add imported targets
# ------------------------------------------------------------------------

if(Boost_FOUND AND _Boost_IMPORTED_TARGETS)
    # For header-only libraries
    if(NOT TARGET Boost::boost)
        add_library(Boost::boost INTERFACE IMPORTED)
        if(Boost_INCLUDE_DIRS)
            set_target_properties(Boost::boost PROPERTIES
                INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
        endif()
    endif()

    foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
        if(NOT TARGET Boost::${COMPONENT})
            string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
            if(Boost_${UPPERCOMPONENT}_FOUND)
                if(Boost_USE_STATIC_LIBS)
                    add_library(Boost::${COMPONENT} STATIC IMPORTED)
                else()
                    # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
                    # libraries as a result.
                    add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
                endif()
                if(Boost_INCLUDE_DIRS)
                    set_target_properties(Boost::${COMPONENT} PROPERTIES
                        INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
                endif()
                if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
                    set_target_properties(Boost::${COMPONENT} PROPERTIES
                        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
                        IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
                endif()
                if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
                    set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
                        IMPORTED_CONFIGURATIONS DEBUG)
                    set_target_properties(Boost::${COMPONENT} PROPERTIES
                        IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
                        IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
                endif()
                if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
                    set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
                        IMPORTED_CONFIGURATIONS RELEASE)
                    set_target_properties(Boost::${COMPONENT} PROPERTIES
                        IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
                        IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
                endif()
                if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
                    unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
                    foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
                        list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
                    endforeach()
                    if(COMPONENT STREQUAL "thread")
                        list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
                    endif()
                    set_target_properties(Boost::${COMPONENT} PROPERTIES
                        INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
                endif()
            endif()
        endif()
    endforeach()
endif()

# (snip)
