123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- if(Boost_VERBOSE OR Boost_DEBUG)
- message(STATUS "Found Boost ${Boost_VERSION} at ${Boost_DIR}")
-
- if(Boost_FIND_QUIETLY)
- set(_BOOST_CONFIG "${_BOOST_CONFIG} QUIET")
- endif()
- if(Boost_FIND_REQUIRED)
- set(_BOOST_CONFIG "${_BOOST_CONFIG} REQUIRED")
- endif()
- foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS)
- if(${Boost_FIND_REQUIRED_${__boost_comp}})
- list(APPEND _BOOST_COMPONENTS ${__boost_comp})
- else()
- list(APPEND _BOOST_OPTIONAL_COMPONENTS ${__boost_comp})
- endif()
- endforeach()
- if(_BOOST_COMPONENTS)
- set(_BOOST_CONFIG "${_BOOST_CONFIG} COMPONENTS ${_BOOST_COMPONENTS}")
- endif()
- if(_BOOST_OPTIONAL_COMPONENTS)
- set(_BOOST_CONFIG "${_BOOST_CONFIG} OPTIONAL_COMPONENTS ${_BOOST_OPTIONAL_COMPONENTS}")
- endif()
- if(_BOOST_CONFIG)
- message(STATUS " Requested configuration:${_BOOST_CONFIG}")
- endif()
- unset(_BOOST_CONFIG)
- unset(_BOOST_COMPONENTS)
- unset(_BOOST_OPTIONAL_COMPONENTS)
- endif()
- macro(boost_find_component comp required quiet)
- set(_BOOST_QUIET)
- if(Boost_FIND_QUIETLY OR ${quiet})
- set(_BOOST_QUIET QUIET)
- endif()
- set(_BOOST_REQUIRED)
- if(${required} AND Boost_FIND_REQUIRED)
- set(_BOOST_REQUIRED REQUIRED)
- endif()
- if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
-
- set(Boost_PYTHON_VERSION "${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
- set(__boost_comp_nv "${CMAKE_MATCH_1}")
- elseif("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])$")
-
- set(Boost_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
- set(__boost_comp_nv "${CMAKE_MATCH_1}")
- else()
- set(__boost_comp_nv "${comp}")
- endif()
- get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE)
- if(Boost_DEBUG)
- message(STATUS "BoostConfig: find_package(boost_${__boost_comp_nv} ${Boost_VERSION} EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR})")
- endif()
- find_package(boost_${__boost_comp_nv} ${Boost_VERSION} EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR})
- set(__boost_comp_found ${boost_${__boost_comp_nv}_FOUND})
-
- set(Boost_${comp}_FOUND ${__boost_comp_found})
-
- string(TOUPPER ${comp} _BOOST_COMP)
- set(Boost_${_BOOST_COMP}_FOUND ${__boost_comp_found})
-
- if(__boost_comp_found)
- list(APPEND Boost_LIBRARIES Boost::${__boost_comp_nv})
- set(Boost_${_BOOST_COMP}_LIBRARY Boost::${__boost_comp_nv})
- if(NOT "${comp}" STREQUAL "${__boost_comp_nv}" AND NOT TARGET Boost::${comp})
-
- add_library(Boost::${comp} INTERFACE IMPORTED)
- set_property(TARGET Boost::${comp} APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::${__boost_comp_nv})
- endif()
- endif()
- unset(_BOOST_REQUIRED)
- unset(_BOOST_QUIET)
- unset(_BOOST_CMAKEDIR)
- unset(__boost_comp_nv)
- unset(__boost_comp_found)
- unset(_BOOST_COMP)
- endmacro()
- macro(boost_find_all_components)
-
- file(GLOB __boost_all_components
- LIST_DIRECTORIES true RELATIVE "${CMAKE_CURRENT_LIST_DIR}/.."
- "${CMAKE_CURRENT_LIST_DIR}/../boost_*-${Boost_VERSION}")
-
- string(REGEX REPLACE "boost_([_a-z0-9]+)-${Boost_VERSION}" "\\1"
- __boost_all_components "${__boost_all_components}")
- if(Boost_DEBUG)
- message(STATUS "BoostConfig: discovered components: ${__boost_all_components}")
- endif()
- list(REMOVE_ITEM __boost_all_components "headers")
-
- foreach(__boost_comp IN LISTS __boost_all_components)
- boost_find_component(${__boost_comp} 0 1)
-
- if(Boost_${__boost_comp}_FOUND)
- list(APPEND Boost_ALL_TARGETS Boost::${__boost_comp})
- endif()
- endforeach()
- unset(__boost_all_components)
- if(Boost_DEBUG)
- message(STATUS "BoostConfig: Boost_ALL_TARGETS: ${Boost_ALL_TARGETS}")
- endif()
- endmacro()
- boost_find_component(headers 1 0)
- if(NOT boost_headers_FOUND)
- set(Boost_FOUND 0)
- set(Boost_NOT_FOUND_MESSAGE "A required dependency, boost_headers, has not been found.")
- return()
- endif()
- set(Boost_MAJOR_VERSION ${Boost_VERSION_MAJOR})
- set(Boost_MINOR_VERSION ${Boost_VERSION_MINOR})
- set(Boost_SUBMINOR_VERSION ${Boost_VERSION_PATCH})
- set(Boost_VERSION_STRING ${Boost_VERSION})
- set(Boost_VERSION_MACRO ${Boost_VERSION_MAJOR}0${Boost_VERSION_MINOR}0${Boost_VERSION_PATCH})
- get_target_property(Boost_INCLUDE_DIRS Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
- set(Boost_LIBRARIES "")
- if("ALL" IN_LIST Boost_FIND_COMPONENTS)
-
- list(LENGTH Boost_FIND_COMPONENTS __boost_find_components_count)
- if(NOT ${__boost_find_components_count} EQUAL 1)
- message(AUTHOR_WARNING "ALL cannot be combined with named components; the named components will be ignored.")
- endif()
- unset(__boost_find_components_count)
- set(Boost_ALL_TARGETS Boost::headers)
- boost_find_all_components()
- else()
- foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS)
- boost_find_component(${__boost_comp} ${Boost_FIND_REQUIRED_${__boost_comp}} 0)
- endforeach()
- endif()
- if(NOT TARGET Boost::boost)
- add_library(Boost::boost INTERFACE IMPORTED)
- set_property(TARGET Boost::boost APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::headers)
-
- add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
- add_library(Boost::disable_autolinking INTERFACE IMPORTED)
- add_library(Boost::dynamic_linking INTERFACE IMPORTED)
- endif()
- if("ALL" IN_LIST Boost_FIND_COMPONENTS)
- set(Boost_ALL_FOUND ${boost_headers_FOUND})
- endif()
|