Update FindBoost.Cmake module to support up to boost 1.70.0 (#1676)
* Remove hardcoded FindBoost.cmake and instead rely on local default
* Revert "Remove hardcoded FindBoost.cmake and instead rely on local default"
This reverts commit 08c576a43f693dea18826a9abc715e878eed57bc.
Also updated FindBoost.Cmake from 266808c413 to handle up to Boost 1.77.0 for ubuntu 16.04 cmake 3.5 compatibility
This commit is contained in:
parent
f716f82067
commit
7455552f23
1 changed files with 379 additions and 280 deletions
|
|
@ -1,237 +1,242 @@
|
||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
#.rst:
|
#[=======================================================================[.rst:
|
||||||
# FindBoost
|
FindBoost
|
||||||
# ---------
|
---------
|
||||||
#
|
|
||||||
# Find Boost include dirs and libraries
|
Find Boost include dirs and libraries
|
||||||
#
|
|
||||||
# Use this module by invoking find_package with the form::
|
Use this module by invoking find_package with the form::
|
||||||
#
|
|
||||||
# find_package(Boost
|
find_package(Boost
|
||||||
# [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
|
[version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
|
||||||
# [REQUIRED] # Fail with error if Boost is not found
|
[REQUIRED] # Fail with error if Boost is not found
|
||||||
# [COMPONENTS <libs>...] # Boost libraries by their canonical name
|
[COMPONENTS <libs>...] # Boost libraries by their canonical name
|
||||||
# # e.g. "date_time" for "libboost_date_time"
|
# e.g. "date_time" for "libboost_date_time"
|
||||||
# [OPTIONAL_COMPONENTS <libs>...]
|
[OPTIONAL_COMPONENTS <libs>...]
|
||||||
# # Optional Boost libraries by their canonical name)
|
# Optional Boost libraries by their canonical name)
|
||||||
# ) # e.g. "date_time" for "libboost_date_time"
|
) # e.g. "date_time" for "libboost_date_time"
|
||||||
#
|
|
||||||
# This module finds headers and requested component libraries OR a CMake
|
This module finds headers and requested component libraries OR a CMake
|
||||||
# package configuration file provided by a "Boost CMake" build. For the
|
package configuration file provided by a "Boost CMake" build. For the
|
||||||
# latter case skip to the "Boost CMake" section below. For the former
|
latter case skip to the "Boost CMake" section below. For the former
|
||||||
# case results are reported in variables::
|
case results are reported in variables::
|
||||||
#
|
|
||||||
# Boost_FOUND - True if headers and requested libraries were found
|
Boost_FOUND - True if headers and requested libraries were found
|
||||||
# Boost_INCLUDE_DIRS - Boost include directories
|
Boost_INCLUDE_DIRS - Boost include directories
|
||||||
# Boost_LIBRARY_DIRS - Link directories for Boost libraries
|
Boost_LIBRARY_DIRS - Link directories for Boost libraries
|
||||||
# Boost_LIBRARIES - Boost component libraries to be linked
|
Boost_LIBRARIES - Boost component libraries to be linked
|
||||||
# Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
|
Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
|
||||||
# Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
|
Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
|
||||||
# target_link_libraries debug/optimized keywords)
|
target_link_libraries debug/optimized keywords)
|
||||||
# Boost_VERSION - BOOST_VERSION value from boost/version.hpp
|
Boost_VERSION - BOOST_VERSION value from boost/version.hpp
|
||||||
# Boost_LIB_VERSION - Version string appended to library filenames
|
Boost_LIB_VERSION - Version string appended to library filenames
|
||||||
# Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
|
Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
|
||||||
# Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
|
Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
|
||||||
# Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
|
Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
|
||||||
# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
|
Boost_VERSION_STRING - Boost version number in x.y.z format
|
||||||
# - Pass to add_definitions() to have diagnostic
|
Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
|
||||||
# information about Boost's automatic linking
|
- Pass to add_definitions() to have diagnostic
|
||||||
# displayed during compilation
|
information about Boost's automatic linking
|
||||||
#
|
displayed during compilation
|
||||||
# Note that Boost Python components require a Python version suffix
|
|
||||||
# (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
|
Note that Boost Python components require a Python version suffix
|
||||||
# versions built against Python 3.6 and 2.7, respectively. This also
|
(Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
|
||||||
# applies to additional components using Python including
|
versions built against Python 3.6 and 2.7, respectively. This also
|
||||||
# ``mpi_python`` and ``numpy``. Earlier Boost releases may use
|
applies to additional components using Python including
|
||||||
# distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
|
``mpi_python`` and ``numpy``. Earlier Boost releases may use
|
||||||
# These may also be used as suffixes, but note that they are not
|
distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
|
||||||
# portable.
|
These may also be used as suffixes, but note that they are not
|
||||||
#
|
portable.
|
||||||
# This module reads hints about search locations from variables::
|
|
||||||
#
|
This module reads hints about search locations from variables::
|
||||||
# BOOST_ROOT - Preferred installation prefix
|
|
||||||
# (or BOOSTROOT)
|
BOOST_ROOT - Preferred installation prefix
|
||||||
# BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
|
(or BOOSTROOT)
|
||||||
# BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
|
BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
|
||||||
# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
|
BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
|
||||||
# specified by these hint variables. Default is OFF.
|
Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
|
||||||
# Boost_ADDITIONAL_VERSIONS
|
specified by these hint variables. Default is OFF.
|
||||||
# - List of Boost versions not known to this module
|
Boost_ADDITIONAL_VERSIONS
|
||||||
# (Boost install locations may contain the version)
|
- List of Boost versions not known to this module
|
||||||
#
|
(Boost install locations may contain the version)
|
||||||
# and saves search results persistently in CMake cache entries::
|
|
||||||
#
|
and saves search results persistently in CMake cache entries::
|
||||||
# Boost_INCLUDE_DIR - Directory containing Boost headers
|
|
||||||
# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
|
Boost_INCLUDE_DIR - Directory containing Boost headers
|
||||||
# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
|
Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
|
||||||
# Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
|
Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
|
||||||
# Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
|
Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
|
||||||
#
|
Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
|
||||||
# The following :prop_tgt:`IMPORTED` targets are also defined::
|
|
||||||
#
|
The following :prop_tgt:`IMPORTED` targets are also defined::
|
||||||
# Boost::boost - Target for header-only dependencies
|
|
||||||
# (Boost include directory)
|
Boost::boost - Target for header-only dependencies
|
||||||
# Boost::<C> - Target for specific component dependency
|
(Boost include directory)
|
||||||
# (shared or static library); <C> is lower-
|
Boost::<C> - Target for specific component dependency
|
||||||
# case
|
(shared or static library); <C> is lower-
|
||||||
# Boost::diagnostic_definitions - interface target to enable diagnostic
|
case
|
||||||
# information about Boost's automatic linking
|
Boost::diagnostic_definitions - interface target to enable diagnostic
|
||||||
# during compilation (adds BOOST_LIB_DIAGNOSTIC)
|
information about Boost's automatic linking
|
||||||
# Boost::disable_autolinking - interface target to disable automatic
|
during compilation (adds BOOST_LIB_DIAGNOSTIC)
|
||||||
# linking with MSVC (adds BOOST_ALL_NO_LIB)
|
Boost::disable_autolinking - interface target to disable automatic
|
||||||
# Boost::dynamic_linking - interface target to enable dynamic linking
|
linking with MSVC (adds BOOST_ALL_NO_LIB)
|
||||||
# linking with MSVC (adds BOOST_ALL_DYN_LINK)
|
Boost::dynamic_linking - interface target to enable dynamic linking
|
||||||
#
|
linking with MSVC (adds BOOST_ALL_DYN_LINK)
|
||||||
# Implicit dependencies such as Boost::filesystem requiring
|
|
||||||
# Boost::system will be automatically detected and satisfied, even
|
Implicit dependencies such as Boost::filesystem requiring
|
||||||
# if system is not specified when using find_package and if
|
Boost::system will be automatically detected and satisfied, even
|
||||||
# Boost::system is not added to target_link_libraries. If using
|
if system is not specified when using find_package and if
|
||||||
# Boost::thread, then Threads::Threads will also be added automatically.
|
Boost::system is not added to target_link_libraries. If using
|
||||||
#
|
Boost::thread, then Threads::Threads will also be added automatically.
|
||||||
# It is important to note that the imported targets behave differently
|
|
||||||
# than variables created by this module: multiple calls to
|
It is important to note that the imported targets behave differently
|
||||||
# find_package(Boost) in the same directory or sub-directories with
|
than variables created by this module: multiple calls to
|
||||||
# different options (e.g. static or shared) will not override the
|
find_package(Boost) in the same directory or sub-directories with
|
||||||
# values of the targets created by the first call.
|
different options (e.g. static or shared) will not override the
|
||||||
#
|
values of the targets created by the first call.
|
||||||
# Users may set these hints or results as cache entries. Projects
|
|
||||||
# should not read these entries directly but instead use the above
|
Users may set these hints or results as cache entries. Projects
|
||||||
# result variables. Note that some hint names start in upper-case
|
should not read these entries directly but instead use the above
|
||||||
# "BOOST". One may specify these as environment variables if they are
|
result variables. Note that some hint names start in upper-case
|
||||||
# not specified as CMake variables or cache entries.
|
"BOOST". One may specify these as environment variables if they are
|
||||||
#
|
not specified as CMake variables or cache entries.
|
||||||
# This module first searches for the Boost header files using the above
|
|
||||||
# hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
|
This module first searches for the Boost header files using the above
|
||||||
# Boost_INCLUDE_DIR. Then it searches for requested component libraries
|
hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
|
||||||
# using the above hints (excluding BOOST_INCLUDEDIR and
|
Boost_INCLUDE_DIR. Then it searches for requested component libraries
|
||||||
# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
|
using the above hints (excluding BOOST_INCLUDEDIR and
|
||||||
# and the library name configuration settings below. It saves the
|
Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
|
||||||
# library directories in Boost_LIBRARY_DIR_DEBUG and
|
and the library name configuration settings below. It saves the
|
||||||
# Boost_LIBRARY_DIR_RELEASE and individual library
|
library directories in Boost_LIBRARY_DIR_DEBUG and
|
||||||
# locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
|
Boost_LIBRARY_DIR_RELEASE and individual library
|
||||||
# When one changes settings used by previous searches in the same build
|
locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
|
||||||
# tree (excluding environment variables) this module discards previous
|
When one changes settings used by previous searches in the same build
|
||||||
# search results affected by the changes and searches again.
|
tree (excluding environment variables) this module discards previous
|
||||||
#
|
search results affected by the changes and searches again.
|
||||||
# Boost libraries come in many variants encoded in their file name.
|
|
||||||
# Users or projects may tell this module which variant to find by
|
Boost libraries come in many variants encoded in their file name.
|
||||||
# setting variables::
|
Users or projects may tell this module which variant to find by
|
||||||
#
|
setting variables::
|
||||||
# Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
|
|
||||||
# and use the debug libraries. Default is ON.
|
Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
|
||||||
# Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
|
and use the debug libraries. Default is ON.
|
||||||
# and use the release libraries. Default is ON.
|
Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
|
||||||
# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
|
and use the release libraries. Default is ON.
|
||||||
# libraries ('mt' tag). Default is ON.
|
Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
|
||||||
# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
|
libraries ('mt' tag). Default is ON.
|
||||||
# libraries. Default is OFF.
|
Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
|
||||||
# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
|
libraries. Default is OFF.
|
||||||
# libraries linked statically to the C++ runtime
|
Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
|
||||||
# ('s' tag). Default is platform dependent.
|
libraries linked statically to the C++ runtime
|
||||||
# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
|
('s' tag). Default is platform dependent.
|
||||||
# libraries linked to the MS debug C++ runtime
|
Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
|
||||||
# ('g' tag). Default is ON.
|
libraries linked to the MS debug C++ runtime
|
||||||
# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
|
('g' tag). Default is ON.
|
||||||
# debug Python build ('y' tag). Default is OFF.
|
Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
|
||||||
# Boost_USE_STLPORT - Set to ON to use libraries compiled with
|
debug Python build ('y' tag). Default is OFF.
|
||||||
# STLPort ('p' tag). Default is OFF.
|
Boost_USE_STLPORT - Set to ON to use libraries compiled with
|
||||||
# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
|
STLPort ('p' tag). Default is OFF.
|
||||||
# - Set to ON to use libraries compiled with
|
Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
|
||||||
# STLPort deprecated "native iostreams"
|
- Set to ON to use libraries compiled with
|
||||||
# ('n' tag). Default is OFF.
|
STLPort deprecated "native iostreams"
|
||||||
# Boost_COMPILER - Set to the compiler-specific library suffix
|
('n' tag). Default is OFF.
|
||||||
# (e.g. "-gcc43"). Default is auto-computed
|
Boost_COMPILER - Set to the compiler-specific library suffix
|
||||||
# for the C++ compiler in use. A list may be
|
(e.g. "-gcc43"). Default is auto-computed
|
||||||
# used if multiple compatible suffixes should
|
for the C++ compiler in use. A list may be
|
||||||
# be tested for, in decreasing order of
|
used if multiple compatible suffixes should
|
||||||
# preference.
|
be tested for, in decreasing order of
|
||||||
# Boost_THREADAPI - Suffix for "thread" component library name,
|
preference.
|
||||||
# such as "pthread" or "win32". Names with
|
Boost_ARCHITECTURE - Set to the architecture-specific library suffix
|
||||||
# and without this suffix will both be tried.
|
(e.g. "-x64"). Default is auto-computed for the
|
||||||
# Boost_NAMESPACE - Alternate namespace used to build boost with
|
C++ compiler in use.
|
||||||
# e.g. if set to "myboost", will search for
|
Boost_THREADAPI - Suffix for "thread" component library name,
|
||||||
# myboost_thread instead of boost_thread.
|
such as "pthread" or "win32". Names with
|
||||||
#
|
and without this suffix will both be tried.
|
||||||
# Other variables one may set to control this module are::
|
Boost_NAMESPACE - Alternate namespace used to build boost with
|
||||||
#
|
e.g. if set to "myboost", will search for
|
||||||
# Boost_DEBUG - Set to ON to enable debug output from FindBoost.
|
myboost_thread instead of boost_thread.
|
||||||
# Please enable this before filing any bug report.
|
|
||||||
# Boost_DETAILED_FAILURE_MSG
|
Other variables one may set to control this module are::
|
||||||
# - Set to ON to add detailed information to the
|
|
||||||
# failure message even when the REQUIRED option
|
Boost_DEBUG - Set to ON to enable debug output from FindBoost.
|
||||||
# is not given to the find_package call.
|
Please enable this before filing any bug report.
|
||||||
# Boost_REALPATH - Set to ON to resolve symlinks for discovered
|
Boost_DETAILED_FAILURE_MSG
|
||||||
# libraries to assist with packaging. For example,
|
- Set to ON to add detailed information to the
|
||||||
# the "system" component library may be resolved to
|
failure message even when the REQUIRED option
|
||||||
# "/usr/lib/libboost_system.so.1.67.0" instead of
|
is not given to the find_package call.
|
||||||
# "/usr/lib/libboost_system.so". This does not
|
Boost_REALPATH - Set to ON to resolve symlinks for discovered
|
||||||
# affect linking and should not be enabled unless
|
libraries to assist with packaging. For example,
|
||||||
# the user needs this information.
|
the "system" component library may be resolved to
|
||||||
# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
|
"/usr/lib/libboost_system.so.1.67.0" instead of
|
||||||
# Boost_LIBRARY_DIR_DEBUG.
|
"/usr/lib/libboost_system.so". This does not
|
||||||
#
|
affect linking and should not be enabled unless
|
||||||
# On Visual Studio and Borland compilers Boost headers request automatic
|
the user needs this information.
|
||||||
# linking to corresponding libraries. This requires matching libraries
|
Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
|
||||||
# to be linked explicitly or available in the link library search path.
|
Boost_LIBRARY_DIR_DEBUG.
|
||||||
# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
|
|
||||||
# dynamic linking. Boost automatic linking typically requests static
|
On Visual Studio and Borland compilers Boost headers request automatic
|
||||||
# libraries with a few exceptions (such as Boost.Python). Use::
|
linking to corresponding libraries. This requires matching libraries
|
||||||
#
|
to be linked explicitly or available in the link library search path.
|
||||||
# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
|
In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
|
||||||
#
|
dynamic linking. Boost automatic linking typically requests static
|
||||||
# to ask Boost to report information about automatic linking requests.
|
libraries with a few exceptions (such as Boost.Python). Use::
|
||||||
#
|
|
||||||
# Example to find Boost headers only::
|
add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
|
||||||
#
|
|
||||||
# find_package(Boost 1.36.0)
|
to ask Boost to report information about automatic linking requests.
|
||||||
# if(Boost_FOUND)
|
|
||||||
# include_directories(${Boost_INCLUDE_DIRS})
|
Example to find Boost headers only::
|
||||||
# add_executable(foo foo.cc)
|
|
||||||
# endif()
|
find_package(Boost 1.36.0)
|
||||||
#
|
if(Boost_FOUND)
|
||||||
# Example to find Boost libraries and use imported targets::
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
#
|
add_executable(foo foo.cc)
|
||||||
# find_package(Boost 1.56 REQUIRED COMPONENTS
|
endif()
|
||||||
# date_time filesystem iostreams)
|
|
||||||
# add_executable(foo foo.cc)
|
Example to find Boost libraries and use imported targets::
|
||||||
# target_link_libraries(foo Boost::date_time Boost::filesystem
|
|
||||||
# Boost::iostreams)
|
find_package(Boost 1.56 REQUIRED COMPONENTS
|
||||||
#
|
date_time filesystem iostreams)
|
||||||
# Example to find Boost Python 3.6 libraries and use imported targets::
|
add_executable(foo foo.cc)
|
||||||
#
|
target_link_libraries(foo Boost::date_time Boost::filesystem
|
||||||
# find_package(Boost 1.67 REQUIRED COMPONENTS
|
Boost::iostreams)
|
||||||
# python36 numpy36)
|
|
||||||
# add_executable(foo foo.cc)
|
Example to find Boost Python 3.6 libraries and use imported targets::
|
||||||
# target_link_libraries(foo Boost::python36 Boost::numpy36)
|
|
||||||
#
|
find_package(Boost 1.67 REQUIRED COMPONENTS
|
||||||
# Example to find Boost headers and some *static* (release only) libraries::
|
python36 numpy36)
|
||||||
#
|
add_executable(foo foo.cc)
|
||||||
# set(Boost_USE_STATIC_LIBS ON) # only find static libs
|
target_link_libraries(foo Boost::python36 Boost::numpy36)
|
||||||
# set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
|
|
||||||
# set(Boost_USE_RELEASE_LIBS ON) # only find release libs
|
Example to find Boost headers and some *static* (release only) libraries::
|
||||||
# set(Boost_USE_MULTITHREADED ON)
|
|
||||||
# set(Boost_USE_STATIC_RUNTIME OFF)
|
set(Boost_USE_STATIC_LIBS ON) # only find static libs
|
||||||
# find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
|
set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
|
||||||
# if(Boost_FOUND)
|
set(Boost_USE_RELEASE_LIBS ON) # only find release libs
|
||||||
# include_directories(${Boost_INCLUDE_DIRS})
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
# add_executable(foo foo.cc)
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||||
# target_link_libraries(foo ${Boost_LIBRARIES})
|
find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
|
||||||
# endif()
|
if(Boost_FOUND)
|
||||||
#
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
# Boost CMake
|
add_executable(foo foo.cc)
|
||||||
# ^^^^^^^^^^^
|
target_link_libraries(foo ${Boost_LIBRARIES})
|
||||||
#
|
endif()
|
||||||
# If Boost was built using the boost-cmake project it provides a package
|
|
||||||
# configuration file for use with find_package's Config mode. This
|
Boost CMake
|
||||||
# module looks for the package configuration file called
|
^^^^^^^^^^^
|
||||||
# BoostConfig.cmake or boost-config.cmake and stores the result in cache
|
|
||||||
# entry "Boost_DIR". If found, the package configuration file is loaded
|
If Boost was built using the boost-cmake project it provides a package
|
||||||
# and this module returns with no further action. See documentation of
|
configuration file for use with find_package's Config mode. This
|
||||||
# the Boost CMake package configuration for details on what it provides.
|
module looks for the package configuration file called
|
||||||
#
|
BoostConfig.cmake or boost-config.cmake and stores the result in cache
|
||||||
# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
|
entry "Boost_DIR". If found, the package configuration file is loaded
|
||||||
|
and this module returns with no further action. See documentation of
|
||||||
|
the Boost CMake package configuration for details on what it provides.
|
||||||
|
|
||||||
|
Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
# Save project's policies
|
# Save project's policies
|
||||||
cmake_policy(PUSH)
|
cmake_policy(PUSH)
|
||||||
|
|
@ -406,15 +411,18 @@ endmacro()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
#
|
# Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
|
||||||
# Runs compiler with "-dumpversion" and parses major/minor
|
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
|
||||||
# version with a regex.
|
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
|
||||||
#
|
_boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
|
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
|
||||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1\\2"
|
_boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
_boost_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
|
||||||
|
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
|
||||||
|
|
||||||
set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
|
set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
|
||||||
|
set(${_OUTPUT_VERSION_MAJOR} ${_boost_COMPILER_VERSION_MAJOR} PARENT_SCOPE)
|
||||||
|
set(${_OUTPUT_VERSION_MINOR} ${_boost_COMPILER_VERSION_MINOR} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -479,25 +487,35 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||||
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
||||||
set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
|
set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
|
||||||
else()
|
else()
|
||||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
|
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
|
||||||
set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
|
set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
|
||||||
|
if(NOT Boost_VERSION VERSION_LESS 106900)
|
||||||
|
# From GCC 5 and clang 4, versioning changes and minor becomes patch.
|
||||||
|
# For those compilers, patch is exclude from compiler tag in Boost 1.69+ library naming.
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 4)
|
||||||
|
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 3)
|
||||||
|
set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
|
||||||
set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
|
set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
|
||||||
else()
|
else()
|
||||||
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
|
|
||||||
# Determine which version of GCC we have.
|
# Determine which version of GCC we have.
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
if(Boost_MINOR_VERSION)
|
if(Boost_MINOR_VERSION)
|
||||||
if(${Boost_MINOR_VERSION} GREATER 35)
|
if(${Boost_MINOR_VERSION} GREATER 35)
|
||||||
# In Boost 1.36.0 and newer, the mangled compiler name used
|
# In Boost 1.36.0 and newer, the mangled compiler name used
|
||||||
# on Mac OS X/Darwin is "xgcc".
|
# on macOS/Darwin is "xgcc".
|
||||||
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
|
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
|
||||||
else()
|
else()
|
||||||
# In Boost <= 1.35.0, there is no mangled compiler name for
|
# In Boost <= 1.35.0, there is no mangled compiler name for
|
||||||
# the Mac OS X/Darwin version of GCC.
|
# the macOS/Darwin version of GCC.
|
||||||
set(_boost_COMPILER "")
|
set(_boost_COMPILER "")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
|
@ -509,7 +527,10 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
|
||||||
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
|
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
# TODO: Find out any Boost version constraints vs clang support.
|
||||||
|
set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
# TODO at least Boost_DEBUG here?
|
# TODO at least Boost_DEBUG here?
|
||||||
set(_boost_COMPILER "")
|
set(_boost_COMPILER "")
|
||||||
|
|
@ -573,7 +594,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(_Boost_IMPORTED_TARGETS TRUE)
|
set(_Boost_IMPORTED_TARGETS TRUE)
|
||||||
if(Boost_VERSION VERSION_LESS 103300)
|
if(Boost_VERSION AND 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)")
|
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)
|
set(_Boost_IMPORTED_TARGETS FALSE)
|
||||||
elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
|
elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
|
||||||
|
|
@ -806,8 +827,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||||
else()
|
elseif(NOT Boost_VERSION VERSION_LESS 106700 AND Boost_VERSION VERSION_LESS 106800)
|
||||||
if(NOT Boost_VERSION VERSION_LESS 106700)
|
|
||||||
set(_Boost_CHRONO_DEPENDENCIES system)
|
set(_Boost_CHRONO_DEPENDENCIES system)
|
||||||
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
||||||
set(_Boost_COROUTINE_DEPENDENCIES context system)
|
set(_Boost_COROUTINE_DEPENDENCIES context system)
|
||||||
|
|
@ -824,8 +844,55 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||||
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||||
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
|
||||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||||
|
elseif(NOT Boost_VERSION VERSION_LESS 106800 AND Boost_VERSION VERSION_LESS 106900)
|
||||||
|
set(_Boost_CHRONO_DEPENDENCIES system)
|
||||||
|
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
|
||||||
|
set(_Boost_CONTRACT_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${component_python_version} mpi serialization)
|
||||||
|
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||||
|
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 106900 AND Boost_VERSION VERSION_LESS 107000)
|
||||||
|
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||||
|
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||||
|
set(_Boost_FIBER_DEPENDENCIES context)
|
||||||
|
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||||
|
set(_Boost_LOG_DEPENDENCIES date_time log_setup 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${component_python_version} mpi serialization)
|
||||||
|
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||||
|
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
|
||||||
|
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||||
|
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||||
|
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||||
|
else()
|
||||||
|
if(NOT Boost_VERSION VERSION_LESS 107000)
|
||||||
|
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||||
|
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||||
|
set(_Boost_FIBER_DEPENDENCIES context)
|
||||||
|
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||||
|
set(_Boost_LOG_DEPENDENCIES date_time log_setup 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${component_python_version} mpi serialization)
|
||||||
|
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||||
|
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
|
||||||
|
set(_Boost_TIMER_DEPENDENCIES chrono system)
|
||||||
|
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||||
|
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||||
endif()
|
endif()
|
||||||
if(NOT Boost_VERSION VERSION_LESS 106800)
|
if(NOT Boost_VERSION VERSION_LESS 107100)
|
||||||
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
|
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -862,7 +929,12 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
|
||||||
set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
|
set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
|
||||||
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
|
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
|
||||||
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
|
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
|
||||||
|
set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
|
||||||
|
if(Boost_VERSION VERSION_LESS 106100)
|
||||||
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
|
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
|
||||||
|
else()
|
||||||
|
set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
|
||||||
|
endif()
|
||||||
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
|
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
|
||||||
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
|
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
|
||||||
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
|
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
|
||||||
|
|
@ -891,6 +963,12 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
|
||||||
set(_Boost_REGEX_HEADERS "boost/regex.hpp")
|
set(_Boost_REGEX_HEADERS "boost/regex.hpp")
|
||||||
set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
|
set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
|
||||||
set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
|
set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
|
||||||
|
set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
|
||||||
|
set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
|
||||||
|
set(_Boost_STACKTRACE_BASIC_HEADERS "boost/stacktrace.hpp")
|
||||||
|
set(_Boost_STACKTRACE_NOOP_HEADERS "boost/stacktrace.hpp")
|
||||||
|
set(_Boost_STACKTRACE_WINDBG_CACHED_HEADERS "boost/stacktrace.hpp")
|
||||||
|
set(_Boost_STACKTRACE_WINDBG_HEADERS "boost/stacktrace.hpp")
|
||||||
set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
|
set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
|
||||||
set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
|
set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
|
||||||
set(_Boost_THREAD_HEADERS "boost/thread.hpp")
|
set(_Boost_THREAD_HEADERS "boost/thread.hpp")
|
||||||
|
|
@ -1062,7 +1140,8 @@ else()
|
||||||
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
|
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
|
||||||
# _Boost_COMPONENT_DEPENDENCIES.
|
# _Boost_COMPONENT_DEPENDENCIES.
|
||||||
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
|
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
|
||||||
"1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
|
"1.70.0" "1.70" "1.69.0" "1.69"
|
||||||
|
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
|
||||||
"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"
|
"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"
|
||||||
"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"
|
"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"
|
||||||
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
|
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
|
||||||
|
|
@ -1219,7 +1298,7 @@ if(NOT Boost_INCLUDE_DIR)
|
||||||
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
||||||
else()
|
else()
|
||||||
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
|
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
|
||||||
foreach(ver ${_Boost_KNOWN_VERSIONS})
|
foreach(ver ${_boost_TEST_VERSIONS})
|
||||||
string(REPLACE "." "_" ver "${ver}")
|
string(REPLACE "." "_" ver "${ver}")
|
||||||
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
|
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
@ -1304,6 +1383,7 @@ if(Boost_INCLUDE_DIR)
|
||||||
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
|
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
|
||||||
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
|
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
|
||||||
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
|
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
|
||||||
|
set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
|
||||||
|
|
||||||
string(APPEND Boost_ERROR_REASON
|
string(APPEND Boost_ERROR_REASON
|
||||||
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
|
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
|
||||||
|
|
@ -1363,6 +1443,13 @@ if ( NOT Boost_NAMESPACE )
|
||||||
set(Boost_NAMESPACE "boost")
|
set(Boost_NAMESPACE "boost")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(Boost_DEBUG)
|
||||||
|
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Boost_LIB_PREFIX = ${Boost_LIB_PREFIX}")
|
||||||
|
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"Boost_NAMESPACE = ${Boost_NAMESPACE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
# Suffix initialization and compiler suffix detection.
|
# Suffix initialization and compiler suffix detection.
|
||||||
# ------------------------------------------------------------------------
|
# ------------------------------------------------------------------------
|
||||||
|
|
@ -1455,20 +1542,27 @@ endif()
|
||||||
# -x86 Architecture and address model tag
|
# -x86 Architecture and address model tag
|
||||||
# First character is the architecture, then word-size, either 32 or 64
|
# First character is the architecture, then word-size, either 32 or 64
|
||||||
# Only used in 'versioned' layout, added in Boost 1.66.0
|
# Only used in 'versioned' layout, added in Boost 1.66.0
|
||||||
set(_boost_ARCHITECTURE_TAG "")
|
if(DEFINED Boost_ARCHITECTURE)
|
||||||
# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
|
set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}")
|
||||||
if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
|
if(Boost_DEBUG)
|
||||||
|
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
|
||||||
|
"using user-specified Boost_ARCHITECTURE = ${_boost_ARCHITECTURE_TAG}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(_boost_ARCHITECTURE_TAG "")
|
||||||
|
# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
|
||||||
|
if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "-")
|
string(APPEND _boost_ARCHITECTURE_TAG "-")
|
||||||
# This needs to be kept in-sync with the section of CMakePlatformId.h.in
|
# This needs to be kept in-sync with the section of CMakePlatformId.h.in
|
||||||
# inside 'defined(_WIN32) && defined(_MSC_VER)'
|
# inside 'defined(_WIN32) && defined(_MSC_VER)'
|
||||||
if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "IA64")
|
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "i")
|
string(APPEND _boost_ARCHITECTURE_TAG "i")
|
||||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "X86"
|
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
|
||||||
OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "x64")
|
OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "x")
|
string(APPEND _boost_ARCHITECTURE_TAG "x")
|
||||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "^ARM")
|
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "a")
|
string(APPEND _boost_ARCHITECTURE_TAG "a")
|
||||||
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "MIPS")
|
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "m")
|
string(APPEND _boost_ARCHITECTURE_TAG "m")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -1477,6 +1571,7 @@ if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSI
|
||||||
else()
|
else()
|
||||||
string(APPEND _boost_ARCHITECTURE_TAG "32")
|
string(APPEND _boost_ARCHITECTURE_TAG "32")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(Boost_DEBUG)
|
if(Boost_DEBUG)
|
||||||
|
|
@ -1530,7 +1625,7 @@ foreach(c DEBUG RELEASE)
|
||||||
if( Boost_NO_SYSTEM_PATHS )
|
if( Boost_NO_SYSTEM_PATHS )
|
||||||
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
|
||||||
else()
|
else()
|
||||||
foreach(ver ${_Boost_KNOWN_VERSIONS})
|
foreach(ver ${_boost_TEST_VERSIONS})
|
||||||
string(REPLACE "." "_" ver "${ver}")
|
string(REPLACE "." "_" ver "${ver}")
|
||||||
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
|
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
@ -1717,6 +1812,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
|
||||||
list(APPEND _boost_RELEASE_NAMES
|
list(APPEND _boost_RELEASE_NAMES
|
||||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
|
||||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
|
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
|
||||||
|
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
|
||||||
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
|
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
|
||||||
if(_boost_STATIC_RUNTIME_WORKAROUND)
|
if(_boost_STATIC_RUNTIME_WORKAROUND)
|
||||||
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
|
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
|
||||||
|
|
@ -2018,6 +2114,9 @@ if(Boost_FOUND)
|
||||||
message (STATUS " ${COMPONENT}")
|
message (STATUS " ${COMPONENT}")
|
||||||
endif()
|
endif()
|
||||||
list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
|
list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
|
||||||
|
if(COMPONENT STREQUAL "thread")
|
||||||
|
list(APPEND Boost_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
else()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue