From 24cd58ae484a340b3669649fb48a95a7565029d0 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 10:10:11 +0100 Subject: [PATCH 01/33] Fix path in cmake config modul of boost --- cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index d7b6bf4a4e..9cee39b1db 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -518,8 +518,8 @@ ExternalProject_Add( ${b2_cmd} -d0 ${build_opts} - stage # install only libraries, headers installed in `url_sha1_boost` - "--stagedir=@HUNTER_PACKAGE_INSTALL_PREFIX@" + install + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" --ignore-site-config # Ignore Gentoo specific optimization "none" in site config that only the patched bjam of Gentoo can understand. LOG_CONFIGURE ${log_build} LOG_BUILD ${log_build} From 2ee27c9922d0432c29e74fc7d1a710aa2fdfde78 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 10:14:26 +0100 Subject: [PATCH 02/33] Remove boost config module in hunter --- cmake/find/FindBoost.cmake | 1324 ----------------- .../Boost/schemes/url_sha1_boost.cmake.in | 7 +- .../schemes/url_sha1_boost_library.cmake.in | 2 +- 3 files changed, 2 insertions(+), 1331 deletions(-) delete mode 100644 cmake/find/FindBoost.cmake diff --git a/cmake/find/FindBoost.cmake b/cmake/find/FindBoost.cmake deleted file mode 100644 index c3f3a9cb58..0000000000 --- a/cmake/find/FindBoost.cmake +++ /dev/null @@ -1,1324 +0,0 @@ -#.rst: -# FindBoost -# --------- -# -# Find Boost include dirs and libraries -# -# Use this module by invoking find_package with the form:: -# -# find_package(Boost -# [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0 -# [REQUIRED] # Fail with error if Boost is not found -# [COMPONENTS ...] # Boost libraries by their canonical name -# ) # e.g. "date_time" for "libboost_date_time" -# -# This module finds headers and requested component libraries OR a CMake -# package configuration file provided by a "Boost CMake" build. For the -# latter case skip to the "Boost CMake" section below. For the former -# case results are reported in variables:: -# -# Boost_FOUND - True if headers and requested libraries were found -# Boost_INCLUDE_DIRS - Boost include directories -# Boost_LIBRARY_DIRS - Link directories for Boost libraries -# Boost_LIBRARIES - Boost component libraries to be linked -# Boost__FOUND - True if component was found ( is upper-case) -# Boost__LIBRARY - Libraries to link for component (may include -# target_link_libraries debug/optimized keywords) -# Boost_VERSION - BOOST_VERSION value from boost/version.hpp -# Boost_LIB_VERSION - Version string appended to library filenames -# 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_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z) -# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows) -# - Pass to add_definitions() to have diagnostic -# information about Boost's automatic linking -# displayed during compilation -# -# This module reads hints about search locations from variables:: -# -# BOOST_ROOT - Preferred installation prefix -# (or BOOSTROOT) -# BOOST_INCLUDEDIR - Preferred include directory e.g. /include -# BOOST_LIBRARYDIR - Preferred library directory e.g. /lib -# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not -# specified by these hint variables. Default is OFF. -# Boost_ADDITIONAL_VERSIONS -# - 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:: -# -# Boost_INCLUDE_DIR - Directory containing Boost headers -# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries -# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries -# Boost__LIBRARY_DEBUG - Component library debug variant -# Boost__LIBRARY_RELEASE - Component library release variant -# -# Users may set these hints or results as cache entries. Projects -# should not read these entries directly but instead use the above -# result variables. Note that some hint names start in upper-case -# "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 -# Boost_INCLUDE_DIR. Then it searches for requested component libraries -# using the above hints (excluding BOOST_INCLUDEDIR and -# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR, -# and the library name configuration settings below. It saves the -# library directories in Boost_LIBRARY_DIR_DEBUG and -# Boost_LIBRARY_DIR_RELEASE and individual library -# locations in Boost__LIBRARY_DEBUG and Boost__LIBRARY_RELEASE. -# When one changes settings used by previous searches in the same build -# 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 -# setting variables:: -# -# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded -# libraries ('mt' tag). Default is ON. -# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static -# libraries. Default is OFF. -# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use -# libraries linked statically to the C++ runtime -# ('s' tag). Default is platform dependent. -# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use -# libraries linked to the MS debug C++ runtime -# ('g' tag). Default is ON. -# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a -# debug Python build ('y' tag). Default is OFF. -# Boost_USE_STLPORT - Set to ON to use libraries compiled with -# STLPort ('p' tag). Default is OFF. -# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS -# - Set to ON to use libraries compiled with -# STLPort deprecated "native iostreams" -# ('n' tag). Default is OFF. -# Boost_COMPILER - Set to the compiler-specific library suffix -# (e.g. "-gcc43"). Default is auto-computed -# for the C++ compiler in use. -# Boost_THREADAPI - Suffix for "thread" component library name, -# such as "pthread" or "win32". Names with -# and without this suffix will both be tried. -# Boost_NAMESPACE - Alternate namespace used to build boost with -# e.g. if set to "myboost", will search for -# myboost_thread instead of boost_thread. -# -# Other variables one may set to control this module are:: -# -# Boost_DEBUG - Set to ON to enable debug output from FindBoost. -# Please enable this before filing any bug report. -# Boost_DETAILED_FAILURE_MSG -# - Set to ON to add detailed information to the -# failure message even when the REQUIRED option -# is not given to the find_package call. -# Boost_REALPATH - Set to ON to resolve symlinks for discovered -# libraries to assist with packaging. For example, -# the "system" component library may be resolved to -# "/usr/lib/libboost_system.so.1.42.0" instead of -# "/usr/lib/libboost_system.so". This does not -# affect linking and should not be enabled unless -# the user needs this information. -# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and -# Boost_LIBRARY_DIR_DEBUG. -# -# On Visual Studio and Borland compilers Boost headers request automatic -# linking to corresponding libraries. This requires matching libraries -# to be linked explicitly or available in the link library search path. -# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve -# dynamic linking. Boost automatic linking typically requests static -# libraries with a few exceptions (such as Boost.Python). Use:: -# -# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) -# -# to ask Boost to report information about automatic linking requests. -# -# Example to find Boost headers only:: -# -# find_package(Boost 1.36.0) -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# endif() -# -# Example to find Boost headers and some *static* libraries:: -# -# set(Boost_USE_STATIC_LIBS ON) # only find static libs -# set(Boost_USE_MULTITHREADED ON) -# set(Boost_USE_STATIC_RUNTIME OFF) -# find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...) -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# target_link_libraries(foo ${Boost_LIBRARIES}) -# endif() -# -# Boost CMake -# ^^^^^^^^^^^ -# -# If Boost was built using the boost-cmake project it provides a package -# configuration file for use with find_package's Config mode. This -# 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 -# 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. - -#============================================================================= -# Copyright 2006-2012 Kitware, Inc. -# Copyright 2006-2008 Andreas Schneider -# Copyright 2007 Wengo -# Copyright 2007 Mike Jackson -# Copyright 2008 Andreas Pakulat -# Copyright 2008-2012 Philip Lowman -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - - -#------------------------------------------------------------------------------- -# Before we go searching, check whether boost-cmake is available, unless the -# user specifically asked NOT to search for boost-cmake. -# -# If Boost_DIR is set, this behaves as any find_package call would. If not, -# it looks at BOOST_ROOT and BOOSTROOT to find Boost. -# -if (NOT Boost_NO_BOOST_CMAKE) - # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives, - # since these are more conventional for Boost. - if ("$ENV{Boost_DIR}" STREQUAL "") - if (NOT "$ENV{BOOST_ROOT}" STREQUAL "") - set(ENV{Boost_DIR} $ENV{BOOST_ROOT}) - elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "") - set(ENV{Boost_DIR} $ENV{BOOSTROOT}) - endif() - endif() - - # Do the same find_package call but look specifically for the CMake version. - # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no - # need to delegate them to this find_package call. - find_package(Boost QUIET NO_MODULE) - mark_as_advanced(Boost_DIR) - - # If we found boost-cmake, then we're done. Print out what we found. - # Otherwise let the rest of the module try to find it. - if (Boost_FOUND) - message("Boost ${Boost_FIND_VERSION} found.") - if (Boost_FIND_COMPONENTS) - message("Found Boost components:") - message(" ${Boost_FIND_COMPONENTS}") - endif() - return() - endif() -endif() - - -#------------------------------------------------------------------------------- -# FindBoost functions & macros -# - -############################################ -# -# Check the existence of the libraries. -# -############################################ -# This macro was taken directly from the FindQt4.cmake file that is included -# with the CMake distribution. This is NOT my work. All work was done by the -# original authors of the FindQt4.cmake file. Only minor modifications were -# made to remove references to Qt and make this file more generally applicable -# And ELSE/ENDIF pairs were removed for readability. -######################################################################### - -macro(_Boost_ADJUST_LIB_VARS basename) - if(Boost_INCLUDE_DIR ) - if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) - # if the generator supports configuration types then set - # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - else() - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) - endif() - # FIXME: This probably should be set for both cases - set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - endif() - - # if only the release version was found, set the debug variable also to the release version - if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) - set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) - set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) - endif() - - # if only the debug version was found, set the release variable also to the debug version - if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) - set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) - set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) - endif() - - # If the debug & release library ends up being the same, omit the keywords - if(${Boost_${basename}_LIBRARY_RELEASE} STREQUAL ${Boost_${basename}_LIBRARY_DEBUG}) - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) - set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} ) - endif() - - if(Boost_${basename}_LIBRARY) - set(Boost_${basename}_FOUND ON) - endif() - - endif() - # Make variables changeable to the advanced user - mark_as_advanced( - Boost_${basename}_LIBRARY_RELEASE - Boost_${basename}_LIBRARY_DEBUG - ) -endmacro() - -# Detect changes in used variables. -# Compares the current variable value with the last one. -# In short form: -# v != v_LAST -> CHANGED = 1 -# v is defined, v_LAST not -> CHANGED = 1 -# v is not defined, but v_LAST is -> CHANGED = 1 -# otherwise -> CHANGED = 0 -# CHANGED is returned in variable named ${changed_var} -macro(_Boost_CHANGE_DETECT changed_var) - set(${changed_var} 0) - foreach(v ${ARGN}) - if(DEFINED _Boost_COMPONENTS_SEARCHED) - if(${v}) - if(_${v}_LAST) - string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED) - else() - set(_${v}_CHANGED 1) - endif() - elseif(_${v}_LAST) - set(_${v}_CHANGED 1) - endif() - if(_${v}_CHANGED) - set(${changed_var} 1) - endif() - else() - set(_${v}_CHANGED 0) - endif() - endforeach() -endmacro() - -# -# Find the given library (var). -# Use 'build_type' to support different lib paths for RELEASE or DEBUG builds -# -macro(_Boost_FIND_LIBRARY var build_type) - - find_library(${var} ${ARGN}) - - if(${var}) - # If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG]. - if(NOT Boost_LIBRARY_DIR_${build_type}) - get_filename_component(_dir "${${var}}" PATH) - set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE) - endif() - elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) - # Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG]. - find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN}) - endif() - - # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there. - if(Boost_LIBRARY_DIR_${build_type}) - set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " Boost_LIBRARY_DIR_${build_type} = ${Boost_LIBRARY_DIR_${build_type}}" - " _boost_LIBRARY_SEARCH_DIRS_${build_type} = ${_boost_LIBRARY_SEARCH_DIRS_${build_type}}") - endif() - endif() -endmacro() - -#------------------------------------------------------------------------------- - -# -# Runs compiler with "-dumpversion" and parses major/minor -# version with a regex. -# -function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) - - exec_program(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _boost_COMPILER_VERSION - ) - string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" - _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) - - set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) -endfunction() - -# -# Take a list of libraries with "thread" in it -# and prepend duplicates with "thread_${Boost_THREADAPI}" -# at the front of the list -# -function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) - set(_orig_libnames ${ARGN}) - string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}") - set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE) -endfunction() - -# -# If a library is found, replace its cache entry with its REALPATH -# -function(_Boost_SWAP_WITH_REALPATH _library _docstring) - if(${_library}) - get_filename_component(_boost_filepathreal ${${_library}} REALPATH) - unset(${_library} CACHE) - set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}") - endif() -endfunction() - -function(_Boost_CHECK_SPELLING _var) - if(${_var}) - string(TOUPPER ${_var} _var_UC) - message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.") - endif() -endfunction() - -# Guesses Boost's compiler prefix used in built library names -# Returns the guess by setting the variable pointed to by _ret -function(_Boost_GUESS_COMPILER_PREFIX _ret) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" - OR CMAKE_CXX_COMPILER MATCHES "icl" - OR CMAKE_CXX_COMPILER MATCHES "icpc") - if(WIN32) - set (_boost_COMPILER "-iw") - else() - set (_boost_COMPILER "-il") - endif() - elseif (GHSMULTI) - set(_boost_COMPILER "-ghs") - elseif (MSVC14) - set(_boost_COMPILER "-vc140") - elseif (MSVC12) - set(_boost_COMPILER "-vc120") - elseif (MSVC11) - set(_boost_COMPILER "-vc110") - elseif (MSVC10) - set(_boost_COMPILER "-vc100") - elseif (MSVC90) - set(_boost_COMPILER "-vc90") - elseif (MSVC80) - set(_boost_COMPILER "-vc80") - elseif (MSVC71) - set(_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - set(_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - set(_boost_COMPILER "-vc6") # yes, this is correct - elseif (BORLAND) - set(_boost_COMPILER "-bcb") - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") - set(_boost_COMPILER "-sw") - elseif (MINGW) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") - endif() - elseif (UNIX) - if (CMAKE_COMPILER_IS_GNUCXX) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - # Determine which version of GCC we have. - if(APPLE) - if(Boost_MINOR_VERSION) - if(${Boost_MINOR_VERSION} GREATER 35) - # In Boost 1.36.0 and newer, the mangled compiler name used - # on Mac OS X/Darwin is "xgcc". - set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - else() - # In Boost <= 1.35.0, there is no mangled compiler name for - # the Mac OS X/Darwin version of GCC. - set(_boost_COMPILER "") - endif() - else() - # We don't know the Boost version, so assume it's - # pre-1.36.0. - set(_boost_COMPILER "") - endif() - else() - set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - endif() - endif() - endif () - else() - # TODO at least Boost_DEBUG here? - set(_boost_COMPILER "") - endif() - set(${_ret} ${_boost_COMPILER} PARENT_SCOPE) -endfunction() - -# -# End functions/macros -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# main. -#------------------------------------------------------------------------------- - - -# If the user sets Boost_LIBRARY_DIR, use it as the default for both -# configurations. -if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR) - set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}") -endif() -if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR) - set(Boost_LIBRARY_DIR_DEBUG "${Boost_LIBRARY_DIR}") -endif() - -if(NOT DEFINED Boost_USE_MULTITHREADED) - set(Boost_USE_MULTITHREADED TRUE) -endif() -if(NOT DEFINED Boost_USE_DEBUG_RUNTIME) - set(Boost_USE_DEBUG_RUNTIME TRUE) -endif() - -# Check the version of Boost against the requested version. -if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - 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") -endif() - -if(Boost_FIND_VERSION_EXACT) - # The version may appear in a directory with or without the patch - # level, even when the patch level is non-zero. - set(_boost_TEST_VERSIONS - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") -else() - # The user has not requested an exact version. Among known - # versions, find those that are acceptable to the user request. - set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "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.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" - "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" - "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" - "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" - "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" - "1.34" "1.33.1" "1.33.0" "1.33") - - set(_boost_TEST_VERSIONS) - if(Boost_FIND_VERSION) - set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - # Select acceptable versions. - foreach(version ${_Boost_KNOWN_VERSIONS}) - if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") - # This version is high enough. - list(APPEND _boost_TEST_VERSIONS "${version}") - elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") - # This version is a short-form for the requested version with - # the patch level dropped. - list(APPEND _boost_TEST_VERSIONS "${version}") - endif() - endforeach() - else() - # Any version is acceptable. - set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") - endif() -endif() - -# The reason that we failed to find Boost. This will be set to a -# user-friendly message when we fail to find some necessary piece of -# Boost. -set(Boost_ERROR_REASON) - -if(Boost_DEBUG) - # Output some of their choices - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") -endif() - -if(WIN32) - # In windows, automatic linking is performed, so you do not have - # to specify the libraries. If you are linking to a dynamic - # runtime, then you can choose to link to either a static or a - # dynamic Boost library, the default is to do a static link. You - # can alter this for a specific library "whatever" by defining - # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be - # linked dynamically. Alternatively you can force all Boost - # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. - - # This feature can be disabled for Boost library "whatever" by - # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining - # BOOST_ALL_NO_LIB. - - # If you want to observe which libraries are being linked against - # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking - # code to emit a #pragma message each time a library is selected - # for linking. - set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC") -endif() - -_Boost_CHECK_SPELLING(Boost_ROOT) -_Boost_CHECK_SPELLING(Boost_LIBRARYDIR) -_Boost_CHECK_SPELLING(Boost_INCLUDEDIR) - -# Collect environment variable inputs as hints. Do not consider changes. -foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR) - set(_env $ENV{${v}}) - if(_env) - file(TO_CMAKE_PATH "${_env}" _ENV_${v}) - else() - set(_ENV_${v} "") - endif() -endforeach() -if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT) - set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}") -endif() - -# Collect inputs and cached results. Detect changes since the last run. -if(NOT BOOST_ROOT AND BOOSTROOT) - set(BOOST_ROOT "${BOOSTROOT}") -endif() -set(_Boost_VARS_DIR - BOOST_ROOT - Boost_NO_SYSTEM_PATHS - ) - -if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Declared as CMake or Environmental Variables:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_ROOT = ${BOOST_ROOT}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") -endif() - -# ------------------------------------------------------------------------ -# Search for Boost include DIR -# ------------------------------------------------------------------------ - -set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS) -_Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC}) -# Clear Boost_INCLUDE_DIR if it did not change but other input affecting the -# location did. We will find a new one based on the new inputs. -if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED) - unset(Boost_INCLUDE_DIR CACHE) -endif() - -if(NOT Boost_INCLUDE_DIR) - set(_boost_INCLUDE_SEARCH_DIRS "") - if(BOOST_INCLUDEDIR) - list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR}) - elseif(_ENV_BOOST_INCLUDEDIR) - list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR}) - endif() - - if( BOOST_ROOT ) - list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT}) - elseif( _ENV_BOOST_ROOT ) - list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT}) - endif() - - if( Boost_NO_SYSTEM_PATHS) - list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH) - else() - list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS - C:/boost/include - C:/boost - /sw/local/include - ) - endif() - - # Try to find Boost by stepping backwards through the Boost versions - # we know about. - # Build a list of path suffixes for each version. - set(_boost_PATH_SUFFIXES) - foreach(_boost_VER ${_boost_TEST_VERSIONS}) - # Add in a path suffix, based on the required version, ideally - # we could read this from version.hpp, but for that to work we'd - # need to know the include dir already - set(_boost_BOOSTIFIED_VERSION) - - # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 - if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)") - set(_boost_BOOSTIFIED_VERSION - "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}") - elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)") - set(_boost_BOOSTIFIED_VERSION - "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") - endif() - - list(APPEND _boost_PATH_SUFFIXES - "boost-${_boost_BOOSTIFIED_VERSION}" - "boost_${_boost_BOOSTIFIED_VERSION}" - "boost/boost-${_boost_BOOSTIFIED_VERSION}" - "boost/boost_${_boost_BOOSTIFIED_VERSION}" - ) - - endforeach() - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Include debugging info:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") - endif() - - # Look for a standard boost header file. - find_path(Boost_INCLUDE_DIR - NAMES boost/config.hpp - HINTS ${_boost_INCLUDE_SEARCH_DIRS} - PATH_SUFFIXES ${_boost_PATH_SUFFIXES} - ) -endif() - -# ------------------------------------------------------------------------ -# Extract version information from version.hpp -# ------------------------------------------------------------------------ - -# Set Boost_FOUND based only on header location and version. -# It will be updated below for component libraries. -if(Boost_INCLUDE_DIR) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") - endif() - - # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp - set(Boost_VERSION 0) - set(Boost_LIB_VERSION "") - file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ") - set(_Boost_VERSION_REGEX "([0-9]+)") - set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"") - foreach(v VERSION LIB_VERSION) - if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}") - set(Boost_${v} "${CMAKE_MATCH_1}") - endif() - endforeach() - unset(_boost_VERSION_HPP_CONTENTS) - - math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "version.hpp reveals boost " - "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - endif() - - if(Boost_FIND_VERSION) - # Set Boost_FOUND based on requested version. - set(_Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - if("${_Boost_VERSION}" VERSION_LESS "${Boost_FIND_VERSION}") - set(Boost_FOUND 0) - set(_Boost_VERSION_AGE "old") - elseif(Boost_FIND_VERSION_EXACT AND - NOT "${_Boost_VERSION}" VERSION_EQUAL "${Boost_FIND_VERSION}") - set(Boost_FOUND 0) - set(_Boost_VERSION_AGE "new") - else() - set(Boost_FOUND 1) - endif() - if(NOT Boost_FOUND) - # State that we found a version of Boost that is too new or too old. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - if (Boost_FIND_VERSION_PATCH) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") - endif () - if (NOT Boost_FIND_VERSION_EXACT) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") - endif () - set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") - endif () - else() - # Caller will accept any Boost version. - set(Boost_FOUND 1) - endif() -else() - set(Boost_FOUND 0) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") -endif() - -# ------------------------------------------------------------------------ -# Prefix initialization -# ------------------------------------------------------------------------ - -set(Boost_LIB_PREFIX "") -if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR - (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) ) - set(Boost_LIB_PREFIX "lib") -endif() - -if ( NOT Boost_NAMESPACE ) - set(Boost_NAMESPACE "boost") -endif() - -# ------------------------------------------------------------------------ -# Suffix initialization and compiler suffix detection. -# ------------------------------------------------------------------------ - -set(_Boost_VARS_NAME - Boost_NAMESPACE - Boost_COMPILER - Boost_THREADAPI - Boost_USE_DEBUG_PYTHON - Boost_USE_MULTITHREADED - Boost_USE_STATIC_LIBS - Boost_USE_STATIC_RUNTIME - Boost_USE_STLPORT - Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS - ) -_Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME}) - -# Setting some more suffixes for the library -if (Boost_COMPILER) - set(_boost_COMPILER ${Boost_COMPILER}) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "using user-specified Boost_COMPILER = ${_boost_COMPILER}") - endif() -else() - # Attempt to guess the compiler suffix - # NOTE: this is not perfect yet, if you experience any issues - # please report them and use the Boost_COMPILER variable - # to work around the problems. - _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "guessed _boost_COMPILER = ${_boost_COMPILER}") - endif() -endif() - -set (_boost_MULTITHREADED "-mt") -if( NOT Boost_USE_MULTITHREADED ) - set (_boost_MULTITHREADED "") -endif() -if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") -endif() - -#====================== -# Systematically build up the Boost ABI tag -# http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming -set( _boost_RELEASE_ABI_TAG "-") -set( _boost_DEBUG_ABI_TAG "-") -# Key Use this library when: -# s linking statically to the C++ standard library and -# compiler runtime support libraries. -if(Boost_USE_STATIC_RUNTIME) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s") -endif() -# g using debug versions of the standard and runtime -# support libraries -if(WIN32 AND Boost_USE_DEBUG_RUNTIME) - if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") - endif() -endif() -# y using special debug build of python -if(Boost_USE_DEBUG_PYTHON) - set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") -endif() -# d using a debug version of your code -set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") -# p using the STLport standard library rather than the -# default one supplied with your compiler -if(Boost_USE_STLPORT) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") -endif() -# n using the STLport deprecated "native iostreams" feature -if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) - set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") - set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") -endif() - -if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") -endif() - -# ------------------------------------------------------------------------ -# Begin finding boost libraries -# ------------------------------------------------------------------------ - -set(_Boost_VARS_LIB "") -foreach(c DEBUG RELEASE) - set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c}) - list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}}) - _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR) - # Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the - # location did. We will find a new one based on the new inputs. - if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED) - unset(Boost_LIBRARY_DIR_${c} CACHE) - endif() - - # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value. - if(Boost_LIBRARY_DIR_${c}) - set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - else() - set(_boost_LIBRARY_SEARCH_DIRS_${c} "") - if(BOOST_LIBRARYDIR) - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR}) - elseif(_ENV_BOOST_LIBRARYDIR) - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR}) - endif() - - if(BOOST_ROOT) - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib) - elseif(_ENV_BOOST_ROOT) - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib) - endif() - - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} - ${Boost_INCLUDE_DIR}/lib - ${Boost_INCLUDE_DIR}/../lib - ${Boost_INCLUDE_DIR}/stage/lib - ) - if( Boost_NO_SYSTEM_PATHS ) - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH) - else() - list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS - C:/boost/lib - C:/boost - /sw/local/lib - ) - endif() - endif() -endforeach() - -if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_LIBRARY_SEARCH_DIRS_RELEASE = ${_boost_LIBRARY_SEARCH_DIRS_RELEASE}" - "_boost_LIBRARY_SEARCH_DIRS_DEBUG = ${_boost_LIBRARY_SEARCH_DIRS_DEBUG}") -endif() - -# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES -if( Boost_USE_STATIC_LIBS ) - set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - if(WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) - endif() -endif() - -# We want to use the tag inline below without risking double dashes -if(_boost_RELEASE_ABI_TAG) - if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") - set(_boost_RELEASE_ABI_TAG "") - endif() -endif() -if(_boost_DEBUG_ABI_TAG) - if(${_boost_DEBUG_ABI_TAG} STREQUAL "-") - set(_boost_DEBUG_ABI_TAG "") - endif() -endif() - -# The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled -# on WIN32 was to: -# 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) -# 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) -# We maintain this behavior since changing it could break people's builds. -# To disable the ambiguous behavior, the user need only -# set Boost_USE_STATIC_RUNTIME either ON or OFF. -set(_boost_STATIC_RUNTIME_WORKAROUND false) -if(WIN32 AND Boost_USE_STATIC_LIBS) - if(NOT DEFINED Boost_USE_STATIC_RUNTIME) - set(_boost_STATIC_RUNTIME_WORKAROUND true) - endif() -endif() - -# On versions < 1.35, remove the System library from the considered list -# since it wasn't added until 1.35. -if(Boost_VERSION AND Boost_FIND_COMPONENTS) - if(Boost_VERSION LESS 103500) - list(REMOVE_ITEM Boost_FIND_COMPONENTS system) - endif() -endif() - -# If the user changed any of our control inputs flush previous results. -if(_Boost_CHANGE_LIBDIR OR _Boost_CHANGE_LIBNAME) - foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - foreach(c DEBUG RELEASE) - set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c}) - unset(${_var} CACHE) - set(${_var} "${_var}-NOTFOUND") - endforeach() - endforeach() - set(_Boost_COMPONENTS_SEARCHED "") -endif() - -foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - - set( _boost_docstring_release "Boost ${COMPONENT} library (release)") - set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") - - # Compute component-specific hints. - set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "") - if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR - ${COMPONENT} STREQUAL "graph_parallel") - foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES}) - if(IS_ABSOLUTE "${lib}") - get_filename_component(libdir "${lib}" PATH) - string(REPLACE "\\" "/" libdir "${libdir}") - list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir}) - endif() - endforeach() - endif() - - # Consolidate and report component-specific hints. - if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) - list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Component-specific library search paths for ${COMPONENT}: " - "${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}") - endif() - endif() - - # - # Find RELEASE libraries - # - set(_boost_RELEASE_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) - - # In Hunter it's possible to have only one variant in root, - # so it's okay to add all of them to search. - foreach(__type i x a m) - foreach(__bit 32 64) - list( - APPEND - _boost_RELEASE_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${__type}${__bit} - ) - endforeach() - endforeach() - - if(_boost_STATIC_RUNTIME_WORKAROUND) - set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") - list(APPEND _boost_RELEASE_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) - endif() - if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") - _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES}) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") - endif() - - # if Boost_LIBRARY_DIR_RELEASE is not defined, - # but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs - if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG) - list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG}) - endif() - - # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. - string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}") - - _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE - NAMES ${_boost_RELEASE_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} - NAMES_PER_DIR - DOC "${_boost_docstring_release}" - ) - - # - # Find DEBUG libraries - # - set(_boost_DEBUG_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) - - # In Hunter it's possible to have only one variant in root, - # so it's okay to add all of them to search. - foreach(__type i x a m) - foreach(__bit 32 64) - list( - APPEND - _boost_DEBUG_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${__type}${__bit} - ) - endforeach() - endforeach() - - if(_boost_STATIC_RUNTIME_WORKAROUND) - set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") - list(APPEND _boost_DEBUG_NAMES - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) - endif() - if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") - _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES}) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") - endif() - - # if Boost_LIBRARY_DIR_DEBUG is not defined, - # but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs - if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE) - list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE}) - endif() - - # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. - string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}") - - _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG - NAMES ${_boost_DEBUG_NAMES} - HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} - NAMES_PER_DIR - DOC "${_boost_docstring_debug}" - ) - - if(Boost_REALPATH) - _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}") - _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" ) - endif() - - _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) - -endforeach() - -# Restore the original find library ordering -if( Boost_USE_STATIC_LIBS ) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -endif() - -# ------------------------------------------------------------------------ -# End finding boost libraries -# ------------------------------------------------------------------------ - -set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) -set(Boost_LIBRARY_DIRS) -if(Boost_LIBRARY_DIR_RELEASE) - list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE}) -endif() -if(Boost_LIBRARY_DIR_DEBUG) - list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG}) -endif() -if(Boost_LIBRARY_DIRS) - list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) -endif() - -# The above setting of Boost_FOUND was based only on the header files. -# Update it for the requested component libraries. -if(Boost_FOUND) - # The headers were found. Check for requested component libs. - set(_boost_CHECKED_COMPONENT FALSE) - set(_Boost_MISSING_COMPONENTS "") - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - set(_boost_CHECKED_COMPONENT TRUE) - if(NOT Boost_${COMPONENT}_FOUND) - string(TOLOWER ${COMPONENT} COMPONENT) - list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) - endif() - endforeach() - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") - endif() - - if (_Boost_MISSING_COMPONENTS) - set(Boost_FOUND 0) - # We were unable to find some libraries, so generate a sensible - # error message that lists the libraries we were unable to find. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nCould not find the following") - if(Boost_USE_STATIC_LIBS) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON} static") - endif() - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON} Boost libraries:\n") - foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON} ${Boost_NAMESPACE}_${COMPONENT}\n") - endforeach() - - list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) - list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) - if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - else () - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - endif () - endif () - - if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - # Compatibility Code for backwards compatibility with CMake - # 2.4's FindBoost module. - - # Look for the boost library path. - # Note that the user may not have installed any libraries - # so it is quite possible the Boost_LIBRARY_DIRS may not exist. - set(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) - - if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") - get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - endif() - - if("${_boost_LIB_DIR}" MATCHES "/include$") - # Strip off the trailing "/include" in the path. - get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - endif() - - if(EXISTS "${_boost_LIB_DIR}/lib") - set(_boost_LIB_DIR ${_boost_LIB_DIR}/lib) - else() - if(EXISTS "${_boost_LIB_DIR}/stage/lib") - set(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) - else() - set(_boost_LIB_DIR "") - endif() - endif() - - if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") - set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR}) - endif() - - endif() -else() - # Boost headers were not found so no components were found. - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} UPPERCOMPONENT) - set(Boost_${UPPERCOMPONENT}_FOUND 0) - endforeach() -endif() - -# ------------------------------------------------------------------------ -# Notification to end user about what was found -# ------------------------------------------------------------------------ - -set(Boost_LIBRARIES "") -if(Boost_FOUND) - if(NOT Boost_FIND_QUIETLY) - message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - if(Boost_FIND_COMPONENTS) - message(STATUS "Found the following Boost libraries:") - endif() - endif() - foreach( COMPONENT ${Boost_FIND_COMPONENTS} ) - string( TOUPPER ${COMPONENT} UPPERCOMPONENT ) - if( Boost_${UPPERCOMPONENT}_FOUND ) - if(NOT Boost_FIND_QUIETLY) - message (STATUS " ${COMPONENT}") - endif() - list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY}) - endif() - endforeach() -else() - if(Boost_FIND_REQUIRED) - message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") - else() - if(NOT Boost_FIND_QUIETLY) - # we opt not to automatically output Boost_ERROR_REASON here as - # it could be quite lengthy and somewhat imposing in its requests - # Since Boost is not always a required dependency we'll leave this - # up to the end-user. - if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) - message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}") - else() - message(STATUS "Could NOT find Boost") - endif() - endif() - endif() -endif() - -# Configure display of cache entries in GUI. -foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB}) - get_property(_type CACHE ${v} PROPERTY TYPE) - if(_type) - set_property(CACHE ${v} PROPERTY ADVANCED 1) - if("x${_type}" STREQUAL "xUNINITIALIZED") - if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS") - set_property(CACHE ${v} PROPERTY TYPE STRING) - else() - set_property(CACHE ${v} PROPERTY TYPE PATH) - endif() - endif() - endif() -endforeach() - -# Record last used values of input variables so we can -# detect on the next run if the user changed them. -foreach(v - ${_Boost_VARS_INC} ${_Boost_VARS_LIB} - ${_Boost_VARS_DIR} ${_Boost_VARS_NAME} - ) - if(DEFINED ${v}) - set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.") - else() - unset(_${v}_LAST CACHE) - endif() -endforeach() - -# Maintain a persistent list of components requested anywhere since -# the last flush. -set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}") -list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS}) -list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED) -list(SORT _Boost_COMPONENTS_SEARCHED) -set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}" - CACHE INTERNAL "Components requested for this build tree.") diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index e426e89ed0..dc4e1694f9 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -144,11 +144,6 @@ ExternalProject_Add( "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P "@HUNTER_SELF@/scripts/try-copy-license.cmake" - COMMAND - "@CMAKE_COMMAND@" - "-Dinstalldir=@HUNTER_PACKAGE_INSTALL_PREFIX@" - -P - "@HUNTER_SELF@/scripts/clean-boost-configs.cmake" LOG_CONFIGURE ${log_build} LOG_BUILD ${log_build} LOG_INSTALL ${log_install} @@ -159,4 +154,4 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -hunter_install_boost_config() +#hunter_install_boost_config() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 9cee39b1db..227de788cf 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -531,4 +531,4 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -hunter_install_boost_config() +#hunter_install_boost_config() From 427825abc58d1f894121a5ad7d47829e62b826d1 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 10:15:16 +0100 Subject: [PATCH 03/33] Increment package id --- cmake/projects/Boost/atomic/hunter.cmake | 2 +- cmake/projects/Boost/chrono/hunter.cmake | 2 +- cmake/projects/Boost/context/hunter.cmake | 2 +- cmake/projects/Boost/contract/hunter.cmake | 2 +- cmake/projects/Boost/coroutine/hunter.cmake | 2 +- cmake/projects/Boost/date_time/hunter.cmake | 2 +- cmake/projects/Boost/exception/hunter.cmake | 2 +- cmake/projects/Boost/fiber/hunter.cmake | 2 +- cmake/projects/Boost/filesystem/hunter.cmake | 2 +- cmake/projects/Boost/graph/hunter.cmake | 2 +- cmake/projects/Boost/graph_parallel/hunter.cmake | 2 +- cmake/projects/Boost/hunter.cmake | 2 +- cmake/projects/Boost/hunter.cmake.in | 2 +- cmake/projects/Boost/iostreams/hunter.cmake | 2 +- cmake/projects/Boost/locale/hunter.cmake | 2 +- cmake/projects/Boost/log/hunter.cmake | 2 +- cmake/projects/Boost/math/hunter.cmake | 2 +- cmake/projects/Boost/mpi/hunter.cmake | 2 +- cmake/projects/Boost/program_options/hunter.cmake | 2 +- cmake/projects/Boost/python/hunter.cmake | 2 +- cmake/projects/Boost/random/hunter.cmake | 2 +- cmake/projects/Boost/regex/hunter.cmake | 2 +- cmake/projects/Boost/serialization/hunter.cmake | 2 +- cmake/projects/Boost/signals/hunter.cmake | 2 +- cmake/projects/Boost/stacktrace/hunter.cmake | 2 +- cmake/projects/Boost/system/hunter.cmake | 2 +- cmake/projects/Boost/test/hunter.cmake | 2 +- cmake/projects/Boost/thread/hunter.cmake | 2 +- cmake/projects/Boost/timer/hunter.cmake | 2 +- cmake/projects/Boost/wave/hunter.cmake | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cmake/projects/Boost/atomic/hunter.cmake b/cmake/projects/Boost/atomic/hunter.cmake index 2aa13e8ec6..c8ed6cbaf5 100644 --- a/cmake/projects/Boost/atomic/hunter.cmake +++ b/cmake/projects/Boost/atomic/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT atomic - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/chrono/hunter.cmake b/cmake/projects/Boost/chrono/hunter.cmake index bc1ad14693..648270226a 100644 --- a/cmake/projects/Boost/chrono/hunter.cmake +++ b/cmake/projects/Boost/chrono/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT chrono - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/context/hunter.cmake b/cmake/projects/Boost/context/hunter.cmake index 9e4a9d5227..542b4930ef 100644 --- a/cmake/projects/Boost/context/hunter.cmake +++ b/cmake/projects/Boost/context/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT context - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/contract/hunter.cmake b/cmake/projects/Boost/contract/hunter.cmake index 021d8949fa..a98fd2ed9b 100644 --- a/cmake/projects/Boost/contract/hunter.cmake +++ b/cmake/projects/Boost/contract/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT contract - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/coroutine/hunter.cmake b/cmake/projects/Boost/coroutine/hunter.cmake index 36cba76fbb..618b07aca1 100644 --- a/cmake/projects/Boost/coroutine/hunter.cmake +++ b/cmake/projects/Boost/coroutine/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT coroutine - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/date_time/hunter.cmake b/cmake/projects/Boost/date_time/hunter.cmake index 1b48156fcd..267ccd90b4 100644 --- a/cmake/projects/Boost/date_time/hunter.cmake +++ b/cmake/projects/Boost/date_time/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT date_time - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/exception/hunter.cmake b/cmake/projects/Boost/exception/hunter.cmake index a4d16a424a..856f8889b9 100644 --- a/cmake/projects/Boost/exception/hunter.cmake +++ b/cmake/projects/Boost/exception/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT exception - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/fiber/hunter.cmake b/cmake/projects/Boost/fiber/hunter.cmake index 8c9bfd605f..900b6fdd92 100644 --- a/cmake/projects/Boost/fiber/hunter.cmake +++ b/cmake/projects/Boost/fiber/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT fiber - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/filesystem/hunter.cmake b/cmake/projects/Boost/filesystem/hunter.cmake index 2ebe65f6a0..4b1fb3cfa8 100644 --- a/cmake/projects/Boost/filesystem/hunter.cmake +++ b/cmake/projects/Boost/filesystem/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT filesystem - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/graph/hunter.cmake b/cmake/projects/Boost/graph/hunter.cmake index ef6951d603..35e827cd82 100644 --- a/cmake/projects/Boost/graph/hunter.cmake +++ b/cmake/projects/Boost/graph/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/graph_parallel/hunter.cmake b/cmake/projects/Boost/graph_parallel/hunter.cmake index ec7c7d4a70..f4461f9153 100644 --- a/cmake/projects/Boost/graph_parallel/hunter.cmake +++ b/cmake/projects/Boost/graph_parallel/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph_parallel - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index f5866cc97c..007fb9f697 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -422,4 +422,4 @@ endif() hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) -hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "45") +hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") diff --git a/cmake/projects/Boost/hunter.cmake.in b/cmake/projects/Boost/hunter.cmake.in index 44a0f7b0c7..588ff7093d 100644 --- a/cmake/projects/Boost/hunter.cmake.in +++ b/cmake/projects/Boost/hunter.cmake.in @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT boost_component - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/iostreams/hunter.cmake b/cmake/projects/Boost/iostreams/hunter.cmake index 2daed6c1df..3bd5053d27 100644 --- a/cmake/projects/Boost/iostreams/hunter.cmake +++ b/cmake/projects/Boost/iostreams/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT iostreams - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/locale/hunter.cmake b/cmake/projects/Boost/locale/hunter.cmake index 4e9a9fe600..6b6cc7dc63 100644 --- a/cmake/projects/Boost/locale/hunter.cmake +++ b/cmake/projects/Boost/locale/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT locale - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/log/hunter.cmake b/cmake/projects/Boost/log/hunter.cmake index c50681a3c7..e0e95e4fbc 100644 --- a/cmake/projects/Boost/log/hunter.cmake +++ b/cmake/projects/Boost/log/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT log - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/math/hunter.cmake b/cmake/projects/Boost/math/hunter.cmake index 06b8b3d520..5b63816155 100644 --- a/cmake/projects/Boost/math/hunter.cmake +++ b/cmake/projects/Boost/math/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT math - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/mpi/hunter.cmake b/cmake/projects/Boost/mpi/hunter.cmake index b07f66168a..52e84041f6 100644 --- a/cmake/projects/Boost/mpi/hunter.cmake +++ b/cmake/projects/Boost/mpi/hunter.cmake @@ -26,5 +26,5 @@ hunter_download( Boost PACKAGE_COMPONENT mpi - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/program_options/hunter.cmake b/cmake/projects/Boost/program_options/hunter.cmake index 550da456bf..58567e6dd6 100644 --- a/cmake/projects/Boost/program_options/hunter.cmake +++ b/cmake/projects/Boost/program_options/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT program_options - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/python/hunter.cmake b/cmake/projects/Boost/python/hunter.cmake index e6147f2657..aa085d0cdf 100644 --- a/cmake/projects/Boost/python/hunter.cmake +++ b/cmake/projects/Boost/python/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT python - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/random/hunter.cmake b/cmake/projects/Boost/random/hunter.cmake index 0a652044c4..c6e7d6d9fe 100644 --- a/cmake/projects/Boost/random/hunter.cmake +++ b/cmake/projects/Boost/random/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT random - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/regex/hunter.cmake b/cmake/projects/Boost/regex/hunter.cmake index fdbd25cd35..b8c905ba9d 100644 --- a/cmake/projects/Boost/regex/hunter.cmake +++ b/cmake/projects/Boost/regex/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT regex - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/serialization/hunter.cmake b/cmake/projects/Boost/serialization/hunter.cmake index 04b6b0980b..0a8a556748 100644 --- a/cmake/projects/Boost/serialization/hunter.cmake +++ b/cmake/projects/Boost/serialization/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT serialization - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/signals/hunter.cmake b/cmake/projects/Boost/signals/hunter.cmake index 5ea8151ec2..db3c17c45b 100644 --- a/cmake/projects/Boost/signals/hunter.cmake +++ b/cmake/projects/Boost/signals/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT signals - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/stacktrace/hunter.cmake b/cmake/projects/Boost/stacktrace/hunter.cmake index 7462ddcfba..f4850a5032 100644 --- a/cmake/projects/Boost/stacktrace/hunter.cmake +++ b/cmake/projects/Boost/stacktrace/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT stacktrace - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/system/hunter.cmake b/cmake/projects/Boost/system/hunter.cmake index b6ff81a21d..dc7e7c43c6 100644 --- a/cmake/projects/Boost/system/hunter.cmake +++ b/cmake/projects/Boost/system/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT system - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/test/hunter.cmake b/cmake/projects/Boost/test/hunter.cmake index 393866d1e8..532c5a185c 100644 --- a/cmake/projects/Boost/test/hunter.cmake +++ b/cmake/projects/Boost/test/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT test - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/thread/hunter.cmake b/cmake/projects/Boost/thread/hunter.cmake index 5da3ce38b8..906485f3ee 100644 --- a/cmake/projects/Boost/thread/hunter.cmake +++ b/cmake/projects/Boost/thread/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT thread - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/timer/hunter.cmake b/cmake/projects/Boost/timer/hunter.cmake index e0e1604d1f..fb1b662300 100644 --- a/cmake/projects/Boost/timer/hunter.cmake +++ b/cmake/projects/Boost/timer/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT timer - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) diff --git a/cmake/projects/Boost/wave/hunter.cmake b/cmake/projects/Boost/wave/hunter.cmake index 94430f7c76..e64fb469e5 100644 --- a/cmake/projects/Boost/wave/hunter.cmake +++ b/cmake/projects/Boost/wave/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT wave - PACKAGE_INTERNAL_DEPS_ID "45" + PACKAGE_INTERNAL_DEPS_ID "46" ) From c98a62765026c3189cf691541a2be4987fd132ad Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 10:17:26 +0100 Subject: [PATCH 04/33] Add Boost_USE_STATIC_LIBS in examples.... --- examples/Boost-chrono/CMakeLists.txt | 13 ++++++++----- examples/Boost-contract/CMakeLists.txt | 8 +++++++- examples/Boost-fiber/CMakeLists.txt | 12 +++++++++--- examples/Boost-filesystem/CMakeLists.txt | 13 ++++++++----- examples/Boost-iostreams/CMakeLists.txt | 12 +++++++++--- examples/Boost-log/CMakeLists.txt | 6 ++++++ examples/Boost-math/CMakeLists.txt | 5 +++++ examples/Boost-program-options/CMakeLists.txt | 6 ++++++ examples/Boost-python/CMakeLists.txt | 2 ++ examples/Boost-random/CMakeLists.txt | 6 ++++++ examples/Boost-stacktrace/CMakeLists.txt | 6 ++++++ examples/Boost-system-1-66/CMakeLists.txt | 2 ++ examples/Boost-system/CMakeLists.txt | 6 ++++++ examples/Boost-test/CMakeLists.txt | 6 ++++++ examples/Boost-thread/CMakeLists.txt | 8 +++++++- examples/Boost-uuid/CMakeLists.txt | 6 ++++++ examples/Boost/CMakeLists.txt | 6 +++++- 17 files changed, 104 insertions(+), 19 deletions(-) diff --git a/examples/Boost-chrono/CMakeLists.txt b/examples/Boost-chrono/CMakeLists.txt index 9b5a8dadd5..26ab1d57d6 100644 --- a/examples/Boost-chrono/CMakeLists.txt +++ b/examples/Boost-chrono/CMakeLists.txt @@ -3,21 +3,24 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS system chrono) -find_package(Boost CONFIG REQUIRED system chrono) +hunter_add_package(Boost COMPONENTS chrono) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + +find_package(Boost CONFIG REQUIRED chrono) add_executable(foo foo.cpp) target_link_libraries( foo PUBLIC Boost::chrono - Boost::system # Should be last - # Boost 1.66.0, Linux, Clang with -stdlib=libstdc++: - # * https://travis-ci.org/ingenue/hunter/jobs/318140468#L2651 ) diff --git a/examples/Boost-contract/CMakeLists.txt b/examples/Boost-contract/CMakeLists.txt index 4ddcf58906..3d7047684c 100644 --- a/examples/Boost-contract/CMakeLists.txt +++ b/examples/Boost-contract/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,7 +12,11 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS system contract) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED system contract) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::system Boost::contract) +target_link_libraries(foo PUBLIC Boost::contract) diff --git a/examples/Boost-fiber/CMakeLists.txt b/examples/Boost-fiber/CMakeLists.txt index 2f6fe07035..0669a0ffd4 100644 --- a/examples/Boost-fiber/CMakeLists.txt +++ b/examples/Boost-fiber/CMakeLists.txt @@ -3,14 +3,20 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS context fiber) -find_package(Boost CONFIG REQUIRED context fiber) +hunter_add_package(Boost COMPONENTS fiber) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + +find_package(Boost CONFIG REQUIRED fiber) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::context Boost::fiber) +target_link_libraries(foo PUBLIC Boost::fiber) diff --git a/examples/Boost-filesystem/CMakeLists.txt b/examples/Boost-filesystem/CMakeLists.txt index 95c1113116..aa8d71d2f1 100644 --- a/examples/Boost-filesystem/CMakeLists.txt +++ b/examples/Boost-filesystem/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,10 +12,14 @@ include("../common.cmake") project(download-boost) # download boost -hunter_add_package(Boost COMPONENTS system filesystem) +hunter_add_package(Boost COMPONENTS filesystem) # now boost can be used -find_package(Boost CONFIG REQUIRED system filesystem) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + +find_package(Boost CONFIG REQUIRED filesystem) if(ANDROID) string(COMPARE EQUAL "${CMAKE_ANDROID_NDK}" "" is_empty) @@ -33,9 +39,6 @@ endif() target_link_libraries( foo Boost::filesystem - Boost::system # Should be last - # Boost 1.66.0, Linux, Clang with -stdlib=libstdc++: - # * https://travis-ci.org/ingenue/hunter/jobs/318140416#L2674 ) if(ANDROID) diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index f6e7051bb4..e9b7acf72d 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -3,14 +3,20 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") project(boost_iostreams) -hunter_add_package(Boost COMPONENTS iostreams serialization) -find_package(Boost CONFIG REQUIRED iostreams serialization) +hunter_add_package(Boost COMPONENTS iostreams) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + +find_package(Boost CONFIG REQUIRED iostreams) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization) +target_link_libraries(foo PUBLIC Boost::iostreams) diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index 35550d4219..2e33f97fec 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS log) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) diff --git a/examples/Boost-math/CMakeLists.txt b/examples/Boost-math/CMakeLists.txt index 843235678c..f217db77ce 100644 --- a/examples/Boost-math/CMakeLists.txt +++ b/examples/Boost-math/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -12,6 +14,9 @@ project(download-boost) # download boost hunter_add_package(Boost COMPONENTS math) +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + # now boost::math_* targets # link in all the parts of boost math, or leave out unneeded parts find_package(Boost CONFIG REQUIRED math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) diff --git a/examples/Boost-program-options/CMakeLists.txt b/examples/Boost-program-options/CMakeLists.txt index f9a68b8db7..45283b8647 100644 --- a/examples/Boost-program-options/CMakeLists.txt +++ b/examples/Boost-program-options/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,4 +12,8 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS program_options) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED COMPONENTS program_options) diff --git a/examples/Boost-python/CMakeLists.txt b/examples/Boost-python/CMakeLists.txt index 85b3d6e26c..dd439a790a 100644 --- a/examples/Boost-python/CMakeLists.txt +++ b/examples/Boost-python/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.2) option(HUNTER_BUILD_SHARED_LIBS "..." ON) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Configure: set(PYTHON_VERSION 3.5) set(TESTING_CONFIG_OPT FILEPATH "${CMAKE_CURRENT_LIST_DIR}/config.cmake") diff --git a/examples/Boost-random/CMakeLists.txt b/examples/Boost-random/CMakeLists.txt index 7721d532e9..9a8ad55636 100644 --- a/examples/Boost-random/CMakeLists.txt +++ b/examples/Boost-random/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost-random) hunter_add_package(Boost COMPONENTS random) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED random) add_executable(foo foo.cpp) diff --git a/examples/Boost-stacktrace/CMakeLists.txt b/examples/Boost-stacktrace/CMakeLists.txt index 27720d5424..9da490425e 100644 --- a/examples/Boost-stacktrace/CMakeLists.txt +++ b/examples/Boost-stacktrace/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.2) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS stacktrace) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED stacktrace_backtrace) add_executable(foo foo.cpp) diff --git a/examples/Boost-system-1-66/CMakeLists.txt b/examples/Boost-system-1-66/CMakeLists.txt index 5d3cfe9f2c..dfb9c11ef6 100644 --- a/examples/Boost-system-1-66/CMakeLists.txt +++ b/examples/Boost-system-1-66/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index a383233257..3f5929edea 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS system) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED system) add_executable(foo foo.cpp) diff --git a/examples/Boost-test/CMakeLists.txt b/examples/Boost-test/CMakeLists.txt index eea8628343..be00d07c0d 100644 --- a/examples/Boost-test/CMakeLists.txt +++ b/examples/Boost-test/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,4 +12,8 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS test) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED COMPONENTS unit_test_framework) diff --git a/examples/Boost-thread/CMakeLists.txt b/examples/Boost-thread/CMakeLists.txt index cdb4d19a80..a17a2fbf0b 100644 --- a/examples/Boost-thread/CMakeLists.txt +++ b/examples/Boost-thread/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,7 +12,11 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS system thread) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED system thread) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::system Boost::thread) +target_link_libraries(foo PUBLIC Boost::thread) diff --git a/examples/Boost-uuid/CMakeLists.txt b/examples/Boost-uuid/CMakeLists.txt index 64c41f30c3..5eef48d824 100644 --- a/examples/Boost-uuid/CMakeLists.txt +++ b/examples/Boost-uuid/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index d1f6c5e0b7..8ccbd97a57 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -10,10 +10,14 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::boost) +target_link_libraries(foo PUBLIC Boost::headers) set(project_license "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") file( From 3965e728a7cd448d2aaf978d4a29f072cafbfeeb Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 17:00:12 +0100 Subject: [PATCH 05/33] Fix boost iostream example... --- examples/Boost-iostreams/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index e9b7acf72d..4fafd356c7 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -11,12 +11,12 @@ include("../common.cmake") project(boost_iostreams) -hunter_add_package(Boost COMPONENTS iostreams) +hunter_add_package(Boost COMPONENTS iostreams serialization) # This is important because Hunter build only boost as a static library by default! set(Boost_USE_STATIC_LIBS ON) -find_package(Boost CONFIG REQUIRED iostreams) +find_package(Boost CONFIG REQUIRED iostreams serialization) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::iostreams) +target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization) From 9aff1b99225851e74c2e21fcfe060bfca8b1da91 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 22 Jan 2020 17:05:59 +0100 Subject: [PATCH 06/33] Fix example, add Boost_USE_STATIC_LIBS --- examples/Boost-serialization/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/Boost-serialization/CMakeLists.txt b/examples/Boost-serialization/CMakeLists.txt index 6fe52a0bfa..f65d0f9016 100644 --- a/examples/Boost-serialization/CMakeLists.txt +++ b/examples/Boost-serialization/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") @@ -10,6 +12,10 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS serialization) + +# This is important because Hunter build only boost as a static library by default! +set(Boost_USE_STATIC_LIBS ON) + find_package(Boost CONFIG REQUIRED serialization) add_executable(foo foo.cpp) From 8311a67a40276425ec3a79d5ff30640a66d4e4df Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Thu, 23 Jan 2020 05:58:33 +0100 Subject: [PATCH 07/33] Add workaround in example to fix test on travis --- examples/Boost-iostreams/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index 4fafd356c7..ef9febed77 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -16,7 +16,9 @@ hunter_add_package(Boost COMPONENTS iostreams serialization) # This is important because Hunter build only boost as a static library by default! set(Boost_USE_STATIC_LIBS ON) +find_package(ZLIB CONFIG REQUIRED) # TODO(BJoe) Should required/include by boost::iostreams +find_package(BZip2 CONFIG REQUIRED) # TODO(BJoe) Should required/include by boost::iostreams find_package(Boost CONFIG REQUIRED iostreams serialization) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization) +target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization ZLIB::zlib BZip2::bz2) From 289bf11c20d665d9256c5beb45ece1d776292fa2 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Thu, 23 Jan 2020 10:51:03 +0100 Subject: [PATCH 08/33] If an older boost version is used... use BoostConfig from hunter --- cmake/projects/Boost/schemes/url_sha1_boost.cmake.in | 4 +++- .../Boost/schemes/url_sha1_boost_ios_library.cmake.in | 4 +++- cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index dc4e1694f9..e32685181b 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -154,4 +154,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -#hunter_install_boost_config() +if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) + hunter_install_boost_config() +endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index 5bb09a5823..88c7206484 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -372,4 +372,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -hunter_install_boost_config() +if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) + hunter_install_boost_config() +endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 227de788cf..f14dd2564f 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -531,4 +531,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -#hunter_install_boost_config() +if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) + hunter_install_boost_config() +endif() From 9e58dbc793285bac2cf4c85eb95183a80eed835d Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Thu, 23 Jan 2020 12:05:12 +0100 Subject: [PATCH 09/33] Try to fix windows test builds --- cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index f14dd2564f..cea5f09de4 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -218,6 +218,7 @@ if(has_toolset_version) endif() set(boost_user_jam "@HUNTER_PACKAGE_BUILD_DIR@/boost.user.jam") +file(TO_NATIVE_PATH "${boost_user_jam}" boost_user_jam_native_path) set( build_opts -a @@ -226,7 +227,7 @@ set( ${variants} --layout=tagged toolset=${toolset_full_name} - "--user-config=${boost_user_jam}" + "--user-config=${boost_user_jam_native_path}" --with-@HUNTER_PACKAGE_COMPONENT@ ) if("@MINGW@") From aa0551c3d21115386cb80b953eb04b35d25b8513 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 25 Jan 2020 07:12:25 +0100 Subject: [PATCH 10/33] Add FindBoost.cmake again, It is needed, even when you set CONFIG in find_package! See BoostConfig line 51 in hunter. The original FindBoost from cmake add for example in iostream regex as required dependency but this is an optional dependency .... --- cmake/find/FindBoost.cmake | 1324 ++++++++++++++++++++++++++++++++++++ 1 file changed, 1324 insertions(+) create mode 100644 cmake/find/FindBoost.cmake diff --git a/cmake/find/FindBoost.cmake b/cmake/find/FindBoost.cmake new file mode 100644 index 0000000000..c3f3a9cb58 --- /dev/null +++ b/cmake/find/FindBoost.cmake @@ -0,0 +1,1324 @@ +#.rst: +# FindBoost +# --------- +# +# Find Boost include dirs and libraries +# +# Use this module by invoking find_package with the form:: +# +# find_package(Boost +# [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0 +# [REQUIRED] # Fail with error if Boost is not found +# [COMPONENTS ...] # Boost libraries by their canonical name +# ) # e.g. "date_time" for "libboost_date_time" +# +# This module finds headers and requested component libraries OR a CMake +# package configuration file provided by a "Boost CMake" build. For the +# latter case skip to the "Boost CMake" section below. For the former +# case results are reported in variables:: +# +# Boost_FOUND - True if headers and requested libraries were found +# Boost_INCLUDE_DIRS - Boost include directories +# Boost_LIBRARY_DIRS - Link directories for Boost libraries +# Boost_LIBRARIES - Boost component libraries to be linked +# Boost__FOUND - True if component was found ( is upper-case) +# Boost__LIBRARY - Libraries to link for component (may include +# target_link_libraries debug/optimized keywords) +# Boost_VERSION - BOOST_VERSION value from boost/version.hpp +# Boost_LIB_VERSION - Version string appended to library filenames +# 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_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z) +# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows) +# - Pass to add_definitions() to have diagnostic +# information about Boost's automatic linking +# displayed during compilation +# +# This module reads hints about search locations from variables:: +# +# BOOST_ROOT - Preferred installation prefix +# (or BOOSTROOT) +# BOOST_INCLUDEDIR - Preferred include directory e.g. /include +# BOOST_LIBRARYDIR - Preferred library directory e.g. /lib +# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not +# specified by these hint variables. Default is OFF. +# Boost_ADDITIONAL_VERSIONS +# - 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:: +# +# Boost_INCLUDE_DIR - Directory containing Boost headers +# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries +# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries +# Boost__LIBRARY_DEBUG - Component library debug variant +# Boost__LIBRARY_RELEASE - Component library release variant +# +# Users may set these hints or results as cache entries. Projects +# should not read these entries directly but instead use the above +# result variables. Note that some hint names start in upper-case +# "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 +# Boost_INCLUDE_DIR. Then it searches for requested component libraries +# using the above hints (excluding BOOST_INCLUDEDIR and +# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR, +# and the library name configuration settings below. It saves the +# library directories in Boost_LIBRARY_DIR_DEBUG and +# Boost_LIBRARY_DIR_RELEASE and individual library +# locations in Boost__LIBRARY_DEBUG and Boost__LIBRARY_RELEASE. +# When one changes settings used by previous searches in the same build +# 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 +# setting variables:: +# +# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded +# libraries ('mt' tag). Default is ON. +# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static +# libraries. Default is OFF. +# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use +# libraries linked statically to the C++ runtime +# ('s' tag). Default is platform dependent. +# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use +# libraries linked to the MS debug C++ runtime +# ('g' tag). Default is ON. +# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a +# debug Python build ('y' tag). Default is OFF. +# Boost_USE_STLPORT - Set to ON to use libraries compiled with +# STLPort ('p' tag). Default is OFF. +# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS +# - Set to ON to use libraries compiled with +# STLPort deprecated "native iostreams" +# ('n' tag). Default is OFF. +# Boost_COMPILER - Set to the compiler-specific library suffix +# (e.g. "-gcc43"). Default is auto-computed +# for the C++ compiler in use. +# Boost_THREADAPI - Suffix for "thread" component library name, +# such as "pthread" or "win32". Names with +# and without this suffix will both be tried. +# Boost_NAMESPACE - Alternate namespace used to build boost with +# e.g. if set to "myboost", will search for +# myboost_thread instead of boost_thread. +# +# Other variables one may set to control this module are:: +# +# Boost_DEBUG - Set to ON to enable debug output from FindBoost. +# Please enable this before filing any bug report. +# Boost_DETAILED_FAILURE_MSG +# - Set to ON to add detailed information to the +# failure message even when the REQUIRED option +# is not given to the find_package call. +# Boost_REALPATH - Set to ON to resolve symlinks for discovered +# libraries to assist with packaging. For example, +# the "system" component library may be resolved to +# "/usr/lib/libboost_system.so.1.42.0" instead of +# "/usr/lib/libboost_system.so". This does not +# affect linking and should not be enabled unless +# the user needs this information. +# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and +# Boost_LIBRARY_DIR_DEBUG. +# +# On Visual Studio and Borland compilers Boost headers request automatic +# linking to corresponding libraries. This requires matching libraries +# to be linked explicitly or available in the link library search path. +# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve +# dynamic linking. Boost automatic linking typically requests static +# libraries with a few exceptions (such as Boost.Python). Use:: +# +# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) +# +# to ask Boost to report information about automatic linking requests. +# +# Example to find Boost headers only:: +# +# find_package(Boost 1.36.0) +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# endif() +# +# Example to find Boost headers and some *static* libraries:: +# +# set(Boost_USE_STATIC_LIBS ON) # only find static libs +# set(Boost_USE_MULTITHREADED ON) +# set(Boost_USE_STATIC_RUNTIME OFF) +# find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...) +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# target_link_libraries(foo ${Boost_LIBRARIES}) +# endif() +# +# Boost CMake +# ^^^^^^^^^^^ +# +# If Boost was built using the boost-cmake project it provides a package +# configuration file for use with find_package's Config mode. This +# 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 +# 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. + +#============================================================================= +# Copyright 2006-2012 Kitware, Inc. +# Copyright 2006-2008 Andreas Schneider +# Copyright 2007 Wengo +# Copyright 2007 Mike Jackson +# Copyright 2008 Andreas Pakulat +# Copyright 2008-2012 Philip Lowman +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +#------------------------------------------------------------------------------- +# Before we go searching, check whether boost-cmake is available, unless the +# user specifically asked NOT to search for boost-cmake. +# +# If Boost_DIR is set, this behaves as any find_package call would. If not, +# it looks at BOOST_ROOT and BOOSTROOT to find Boost. +# +if (NOT Boost_NO_BOOST_CMAKE) + # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives, + # since these are more conventional for Boost. + if ("$ENV{Boost_DIR}" STREQUAL "") + if (NOT "$ENV{BOOST_ROOT}" STREQUAL "") + set(ENV{Boost_DIR} $ENV{BOOST_ROOT}) + elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "") + set(ENV{Boost_DIR} $ENV{BOOSTROOT}) + endif() + endif() + + # Do the same find_package call but look specifically for the CMake version. + # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no + # need to delegate them to this find_package call. + find_package(Boost QUIET NO_MODULE) + mark_as_advanced(Boost_DIR) + + # If we found boost-cmake, then we're done. Print out what we found. + # Otherwise let the rest of the module try to find it. + if (Boost_FOUND) + message("Boost ${Boost_FIND_VERSION} found.") + if (Boost_FIND_COMPONENTS) + message("Found Boost components:") + message(" ${Boost_FIND_COMPONENTS}") + endif() + return() + endif() +endif() + + +#------------------------------------------------------------------------------- +# FindBoost functions & macros +# + +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +# And ELSE/ENDIF pairs were removed for readability. +######################################################################### + +macro(_Boost_ADJUST_LIB_VARS basename) + if(Boost_INCLUDE_DIR ) + if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) + # if the generator supports configuration types then set + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value + if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + else() + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) + endif() + # FIXME: This probably should be set for both cases + set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + endif() + + # if only the release version was found, set the debug variable also to the release version + if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) + set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) + set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) + endif() + + # if only the debug version was found, set the release variable also to the debug version + if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) + set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) + set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) + endif() + + # If the debug & release library ends up being the same, omit the keywords + if(${Boost_${basename}_LIBRARY_RELEASE} STREQUAL ${Boost_${basename}_LIBRARY_DEBUG}) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) + set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} ) + endif() + + if(Boost_${basename}_LIBRARY) + set(Boost_${basename}_FOUND ON) + endif() + + endif() + # Make variables changeable to the advanced user + mark_as_advanced( + Boost_${basename}_LIBRARY_RELEASE + Boost_${basename}_LIBRARY_DEBUG + ) +endmacro() + +# Detect changes in used variables. +# Compares the current variable value with the last one. +# In short form: +# v != v_LAST -> CHANGED = 1 +# v is defined, v_LAST not -> CHANGED = 1 +# v is not defined, but v_LAST is -> CHANGED = 1 +# otherwise -> CHANGED = 0 +# CHANGED is returned in variable named ${changed_var} +macro(_Boost_CHANGE_DETECT changed_var) + set(${changed_var} 0) + foreach(v ${ARGN}) + if(DEFINED _Boost_COMPONENTS_SEARCHED) + if(${v}) + if(_${v}_LAST) + string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED) + else() + set(_${v}_CHANGED 1) + endif() + elseif(_${v}_LAST) + set(_${v}_CHANGED 1) + endif() + if(_${v}_CHANGED) + set(${changed_var} 1) + endif() + else() + set(_${v}_CHANGED 0) + endif() + endforeach() +endmacro() + +# +# Find the given library (var). +# Use 'build_type' to support different lib paths for RELEASE or DEBUG builds +# +macro(_Boost_FIND_LIBRARY var build_type) + + find_library(${var} ${ARGN}) + + if(${var}) + # If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG]. + if(NOT Boost_LIBRARY_DIR_${build_type}) + get_filename_component(_dir "${${var}}" PATH) + set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE) + endif() + elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) + # Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG]. + find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN}) + endif() + + # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there. + if(Boost_LIBRARY_DIR_${build_type}) + set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " Boost_LIBRARY_DIR_${build_type} = ${Boost_LIBRARY_DIR_${build_type}}" + " _boost_LIBRARY_SEARCH_DIRS_${build_type} = ${_boost_LIBRARY_SEARCH_DIRS_${build_type}}") + endif() + endif() +endmacro() + +#------------------------------------------------------------------------------- + +# +# Runs compiler with "-dumpversion" and parses major/minor +# version with a regex. +# +function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) + + exec_program(${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _boost_COMPILER_VERSION + ) + string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) + + set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) +endfunction() + +# +# Take a list of libraries with "thread" in it +# and prepend duplicates with "thread_${Boost_THREADAPI}" +# at the front of the list +# +function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) + set(_orig_libnames ${ARGN}) + string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}") + set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE) +endfunction() + +# +# If a library is found, replace its cache entry with its REALPATH +# +function(_Boost_SWAP_WITH_REALPATH _library _docstring) + if(${_library}) + get_filename_component(_boost_filepathreal ${${_library}} REALPATH) + unset(${_library} CACHE) + set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}") + endif() +endfunction() + +function(_Boost_CHECK_SPELLING _var) + if(${_var}) + string(TOUPPER ${_var} _var_UC) + message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.") + endif() +endfunction() + +# Guesses Boost's compiler prefix used in built library names +# Returns the guess by setting the variable pointed to by _ret +function(_Boost_GUESS_COMPILER_PREFIX _ret) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" + OR CMAKE_CXX_COMPILER MATCHES "icl" + OR CMAKE_CXX_COMPILER MATCHES "icpc") + if(WIN32) + set (_boost_COMPILER "-iw") + else() + set (_boost_COMPILER "-il") + endif() + elseif (GHSMULTI) + set(_boost_COMPILER "-ghs") + elseif (MSVC14) + set(_boost_COMPILER "-vc140") + elseif (MSVC12) + set(_boost_COMPILER "-vc120") + elseif (MSVC11) + set(_boost_COMPILER "-vc110") + elseif (MSVC10) + set(_boost_COMPILER "-vc100") + elseif (MSVC90) + set(_boost_COMPILER "-vc90") + elseif (MSVC80) + set(_boost_COMPILER "-vc80") + elseif (MSVC71) + set(_boost_COMPILER "-vc71") + elseif (MSVC70) # Good luck! + set(_boost_COMPILER "-vc7") # yes, this is correct + elseif (MSVC60) # Good luck! + set(_boost_COMPILER "-vc6") # yes, this is correct + elseif (BORLAND) + set(_boost_COMPILER "-bcb") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") + set(_boost_COMPILER "-sw") + elseif (MINGW) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + endif() + elseif (UNIX) + if (CMAKE_COMPILER_IS_GNUCXX) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + # Determine which version of GCC we have. + if(APPLE) + if(Boost_MINOR_VERSION) + if(${Boost_MINOR_VERSION} GREATER 35) + # In Boost 1.36.0 and newer, the mangled compiler name used + # on Mac OS X/Darwin is "xgcc". + set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + else() + # In Boost <= 1.35.0, there is no mangled compiler name for + # the Mac OS X/Darwin version of GCC. + set(_boost_COMPILER "") + endif() + else() + # We don't know the Boost version, so assume it's + # pre-1.36.0. + set(_boost_COMPILER "") + endif() + else() + set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + endif() + endif() + endif () + else() + # TODO at least Boost_DEBUG here? + set(_boost_COMPILER "") + endif() + set(${_ret} ${_boost_COMPILER} PARENT_SCOPE) +endfunction() + +# +# End functions/macros +# +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# main. +#------------------------------------------------------------------------------- + + +# If the user sets Boost_LIBRARY_DIR, use it as the default for both +# configurations. +if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR) + set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}") +endif() +if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR) + set(Boost_LIBRARY_DIR_DEBUG "${Boost_LIBRARY_DIR}") +endif() + +if(NOT DEFINED Boost_USE_MULTITHREADED) + set(Boost_USE_MULTITHREADED TRUE) +endif() +if(NOT DEFINED Boost_USE_DEBUG_RUNTIME) + set(Boost_USE_DEBUG_RUNTIME TRUE) +endif() + +# Check the version of Boost against the requested version. +if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + 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") +endif() + +if(Boost_FIND_VERSION_EXACT) + # The version may appear in a directory with or without the patch + # level, even when the patch level is non-zero. + set(_boost_TEST_VERSIONS + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") +else() + # The user has not requested an exact version. Among known + # versions, find those that are acceptable to the user request. + set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} + "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.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" + "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" + "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" + "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" + "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" + "1.34" "1.33.1" "1.33.0" "1.33") + + set(_boost_TEST_VERSIONS) + if(Boost_FIND_VERSION) + set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + # Select acceptable versions. + foreach(version ${_Boost_KNOWN_VERSIONS}) + if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") + # This version is high enough. + list(APPEND _boost_TEST_VERSIONS "${version}") + elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") + # This version is a short-form for the requested version with + # the patch level dropped. + list(APPEND _boost_TEST_VERSIONS "${version}") + endif() + endforeach() + else() + # Any version is acceptable. + set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") + endif() +endif() + +# The reason that we failed to find Boost. This will be set to a +# user-friendly message when we fail to find some necessary piece of +# Boost. +set(Boost_ERROR_REASON) + +if(Boost_DEBUG) + # Output some of their choices + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") +endif() + +if(WIN32) + # In windows, automatic linking is performed, so you do not have + # to specify the libraries. If you are linking to a dynamic + # runtime, then you can choose to link to either a static or a + # dynamic Boost library, the default is to do a static link. You + # can alter this for a specific library "whatever" by defining + # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be + # linked dynamically. Alternatively you can force all Boost + # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. + + # This feature can be disabled for Boost library "whatever" by + # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining + # BOOST_ALL_NO_LIB. + + # If you want to observe which libraries are being linked against + # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking + # code to emit a #pragma message each time a library is selected + # for linking. + set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC") +endif() + +_Boost_CHECK_SPELLING(Boost_ROOT) +_Boost_CHECK_SPELLING(Boost_LIBRARYDIR) +_Boost_CHECK_SPELLING(Boost_INCLUDEDIR) + +# Collect environment variable inputs as hints. Do not consider changes. +foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR) + set(_env $ENV{${v}}) + if(_env) + file(TO_CMAKE_PATH "${_env}" _ENV_${v}) + else() + set(_ENV_${v} "") + endif() +endforeach() +if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT) + set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}") +endif() + +# Collect inputs and cached results. Detect changes since the last run. +if(NOT BOOST_ROOT AND BOOSTROOT) + set(BOOST_ROOT "${BOOSTROOT}") +endif() +set(_Boost_VARS_DIR + BOOST_ROOT + Boost_NO_SYSTEM_PATHS + ) + +if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Declared as CMake or Environmental Variables:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_ROOT = ${BOOST_ROOT}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") +endif() + +# ------------------------------------------------------------------------ +# Search for Boost include DIR +# ------------------------------------------------------------------------ + +set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS) +_Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC}) +# Clear Boost_INCLUDE_DIR if it did not change but other input affecting the +# location did. We will find a new one based on the new inputs. +if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED) + unset(Boost_INCLUDE_DIR CACHE) +endif() + +if(NOT Boost_INCLUDE_DIR) + set(_boost_INCLUDE_SEARCH_DIRS "") + if(BOOST_INCLUDEDIR) + list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR}) + elseif(_ENV_BOOST_INCLUDEDIR) + list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR}) + endif() + + if( BOOST_ROOT ) + list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT}) + elseif( _ENV_BOOST_ROOT ) + list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT}) + endif() + + if( Boost_NO_SYSTEM_PATHS) + list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH) + else() + list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS + C:/boost/include + C:/boost + /sw/local/include + ) + endif() + + # Try to find Boost by stepping backwards through the Boost versions + # we know about. + # Build a list of path suffixes for each version. + set(_boost_PATH_SUFFIXES) + foreach(_boost_VER ${_boost_TEST_VERSIONS}) + # Add in a path suffix, based on the required version, ideally + # we could read this from version.hpp, but for that to work we'd + # need to know the include dir already + set(_boost_BOOSTIFIED_VERSION) + + # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 + if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)") + set(_boost_BOOSTIFIED_VERSION + "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}") + elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)") + set(_boost_BOOSTIFIED_VERSION + "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") + endif() + + list(APPEND _boost_PATH_SUFFIXES + "boost-${_boost_BOOSTIFIED_VERSION}" + "boost_${_boost_BOOSTIFIED_VERSION}" + "boost/boost-${_boost_BOOSTIFIED_VERSION}" + "boost/boost_${_boost_BOOSTIFIED_VERSION}" + ) + + endforeach() + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Include debugging info:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") + endif() + + # Look for a standard boost header file. + find_path(Boost_INCLUDE_DIR + NAMES boost/config.hpp + HINTS ${_boost_INCLUDE_SEARCH_DIRS} + PATH_SUFFIXES ${_boost_PATH_SUFFIXES} + ) +endif() + +# ------------------------------------------------------------------------ +# Extract version information from version.hpp +# ------------------------------------------------------------------------ + +# Set Boost_FOUND based only on header location and version. +# It will be updated below for component libraries. +if(Boost_INCLUDE_DIR) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") + endif() + + # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp + set(Boost_VERSION 0) + set(Boost_LIB_VERSION "") + file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ") + set(_Boost_VERSION_REGEX "([0-9]+)") + set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"") + foreach(v VERSION LIB_VERSION) + if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}") + set(Boost_${v} "${CMAKE_MATCH_1}") + endif() + endforeach() + unset(_boost_VERSION_HPP_CONTENTS) + + math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "version.hpp reveals boost " + "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + endif() + + if(Boost_FIND_VERSION) + # Set Boost_FOUND based on requested version. + set(_Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + if("${_Boost_VERSION}" VERSION_LESS "${Boost_FIND_VERSION}") + set(Boost_FOUND 0) + set(_Boost_VERSION_AGE "old") + elseif(Boost_FIND_VERSION_EXACT AND + NOT "${_Boost_VERSION}" VERSION_EQUAL "${Boost_FIND_VERSION}") + set(Boost_FOUND 0) + set(_Boost_VERSION_AGE "new") + else() + set(Boost_FOUND 1) + endif() + if(NOT Boost_FOUND) + # State that we found a version of Boost that is too new or too old. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + if (Boost_FIND_VERSION_PATCH) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") + endif () + if (NOT Boost_FIND_VERSION_EXACT) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") + endif () + set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") + endif () + else() + # Caller will accept any Boost version. + set(Boost_FOUND 1) + endif() +else() + set(Boost_FOUND 0) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") +endif() + +# ------------------------------------------------------------------------ +# Prefix initialization +# ------------------------------------------------------------------------ + +set(Boost_LIB_PREFIX "") +if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR + (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) ) + set(Boost_LIB_PREFIX "lib") +endif() + +if ( NOT Boost_NAMESPACE ) + set(Boost_NAMESPACE "boost") +endif() + +# ------------------------------------------------------------------------ +# Suffix initialization and compiler suffix detection. +# ------------------------------------------------------------------------ + +set(_Boost_VARS_NAME + Boost_NAMESPACE + Boost_COMPILER + Boost_THREADAPI + Boost_USE_DEBUG_PYTHON + Boost_USE_MULTITHREADED + Boost_USE_STATIC_LIBS + Boost_USE_STATIC_RUNTIME + Boost_USE_STLPORT + Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS + ) +_Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME}) + +# Setting some more suffixes for the library +if (Boost_COMPILER) + set(_boost_COMPILER ${Boost_COMPILER}) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "using user-specified Boost_COMPILER = ${_boost_COMPILER}") + endif() +else() + # Attempt to guess the compiler suffix + # NOTE: this is not perfect yet, if you experience any issues + # please report them and use the Boost_COMPILER variable + # to work around the problems. + _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "guessed _boost_COMPILER = ${_boost_COMPILER}") + endif() +endif() + +set (_boost_MULTITHREADED "-mt") +if( NOT Boost_USE_MULTITHREADED ) + set (_boost_MULTITHREADED "") +endif() +if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") +endif() + +#====================== +# Systematically build up the Boost ABI tag +# http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming +set( _boost_RELEASE_ABI_TAG "-") +set( _boost_DEBUG_ABI_TAG "-") +# Key Use this library when: +# s linking statically to the C++ standard library and +# compiler runtime support libraries. +if(Boost_USE_STATIC_RUNTIME) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s") +endif() +# g using debug versions of the standard and runtime +# support libraries +if(WIN32 AND Boost_USE_DEBUG_RUNTIME) + if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") + endif() +endif() +# y using special debug build of python +if(Boost_USE_DEBUG_PYTHON) + set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") +endif() +# d using a debug version of your code +set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") +# p using the STLport standard library rather than the +# default one supplied with your compiler +if(Boost_USE_STLPORT) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") +endif() +# n using the STLport deprecated "native iostreams" feature +if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") +endif() + +if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") +endif() + +# ------------------------------------------------------------------------ +# Begin finding boost libraries +# ------------------------------------------------------------------------ + +set(_Boost_VARS_LIB "") +foreach(c DEBUG RELEASE) + set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c}) + list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}}) + _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR) + # Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the + # location did. We will find a new one based on the new inputs. + if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED) + unset(Boost_LIBRARY_DIR_${c} CACHE) + endif() + + # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value. + if(Boost_LIBRARY_DIR_${c}) + set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + else() + set(_boost_LIBRARY_SEARCH_DIRS_${c} "") + if(BOOST_LIBRARYDIR) + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR}) + elseif(_ENV_BOOST_LIBRARYDIR) + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR}) + endif() + + if(BOOST_ROOT) + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib) + elseif(_ENV_BOOST_ROOT) + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib) + endif() + + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} + ${Boost_INCLUDE_DIR}/lib + ${Boost_INCLUDE_DIR}/../lib + ${Boost_INCLUDE_DIR}/stage/lib + ) + if( Boost_NO_SYSTEM_PATHS ) + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH) + else() + list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS + C:/boost/lib + C:/boost + /sw/local/lib + ) + endif() + endif() +endforeach() + +if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_LIBRARY_SEARCH_DIRS_RELEASE = ${_boost_LIBRARY_SEARCH_DIRS_RELEASE}" + "_boost_LIBRARY_SEARCH_DIRS_DEBUG = ${_boost_LIBRARY_SEARCH_DIRS_DEBUG}") +endif() + +# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES +if( Boost_USE_STATIC_LIBS ) + set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) + endif() +endif() + +# We want to use the tag inline below without risking double dashes +if(_boost_RELEASE_ABI_TAG) + if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") + set(_boost_RELEASE_ABI_TAG "") + endif() +endif() +if(_boost_DEBUG_ABI_TAG) + if(${_boost_DEBUG_ABI_TAG} STREQUAL "-") + set(_boost_DEBUG_ABI_TAG "") + endif() +endif() + +# The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled +# on WIN32 was to: +# 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) +# 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) +# We maintain this behavior since changing it could break people's builds. +# To disable the ambiguous behavior, the user need only +# set Boost_USE_STATIC_RUNTIME either ON or OFF. +set(_boost_STATIC_RUNTIME_WORKAROUND false) +if(WIN32 AND Boost_USE_STATIC_LIBS) + if(NOT DEFINED Boost_USE_STATIC_RUNTIME) + set(_boost_STATIC_RUNTIME_WORKAROUND true) + endif() +endif() + +# On versions < 1.35, remove the System library from the considered list +# since it wasn't added until 1.35. +if(Boost_VERSION AND Boost_FIND_COMPONENTS) + if(Boost_VERSION LESS 103500) + list(REMOVE_ITEM Boost_FIND_COMPONENTS system) + endif() +endif() + +# If the user changed any of our control inputs flush previous results. +if(_Boost_CHANGE_LIBDIR OR _Boost_CHANGE_LIBNAME) + foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + foreach(c DEBUG RELEASE) + set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c}) + unset(${_var} CACHE) + set(${_var} "${_var}-NOTFOUND") + endforeach() + endforeach() + set(_Boost_COMPONENTS_SEARCHED "") +endif() + +foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + + set( _boost_docstring_release "Boost ${COMPONENT} library (release)") + set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") + + # Compute component-specific hints. + set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "") + if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR + ${COMPONENT} STREQUAL "graph_parallel") + foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES}) + if(IS_ABSOLUTE "${lib}") + get_filename_component(libdir "${lib}" PATH) + string(REPLACE "\\" "/" libdir "${libdir}") + list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir}) + endif() + endforeach() + endif() + + # Consolidate and report component-specific hints. + if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) + list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Component-specific library search paths for ${COMPONENT}: " + "${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}") + endif() + endif() + + # + # Find RELEASE libraries + # + set(_boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) + + # In Hunter it's possible to have only one variant in root, + # so it's okay to add all of them to search. + foreach(__type i x a m) + foreach(__bit 32 64) + list( + APPEND + _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${__type}${__bit} + ) + endforeach() + endforeach() + + if(_boost_STATIC_RUNTIME_WORKAROUND) + set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") + list(APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) + endif() + if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") + _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES}) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") + endif() + + # if Boost_LIBRARY_DIR_RELEASE is not defined, + # but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs + if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG) + list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG}) + endif() + + # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. + string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}") + + _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE + NAMES ${_boost_RELEASE_NAMES} + HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} + NAMES_PER_DIR + DOC "${_boost_docstring_release}" + ) + + # + # Find DEBUG libraries + # + set(_boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) + + # In Hunter it's possible to have only one variant in root, + # so it's okay to add all of them to search. + foreach(__type i x a m) + foreach(__bit 32 64) + list( + APPEND + _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${__type}${__bit} + ) + endforeach() + endforeach() + + if(_boost_STATIC_RUNTIME_WORKAROUND) + set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") + list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) + endif() + if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") + _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES}) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") + endif() + + # if Boost_LIBRARY_DIR_DEBUG is not defined, + # but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs + if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE) + list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE}) + endif() + + # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing. + string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}") + + _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG + NAMES ${_boost_DEBUG_NAMES} + HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp} + NAMES_PER_DIR + DOC "${_boost_docstring_debug}" + ) + + if(Boost_REALPATH) + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}") + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" ) + endif() + + _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + +endforeach() + +# Restore the original find library ordering +if( Boost_USE_STATIC_LIBS ) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) +endif() + +# ------------------------------------------------------------------------ +# End finding boost libraries +# ------------------------------------------------------------------------ + +set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) +set(Boost_LIBRARY_DIRS) +if(Boost_LIBRARY_DIR_RELEASE) + list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE}) +endif() +if(Boost_LIBRARY_DIR_DEBUG) + list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG}) +endif() +if(Boost_LIBRARY_DIRS) + list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) +endif() + +# The above setting of Boost_FOUND was based only on the header files. +# Update it for the requested component libraries. +if(Boost_FOUND) + # The headers were found. Check for requested component libs. + set(_boost_CHECKED_COMPONENT FALSE) + set(_Boost_MISSING_COMPONENTS "") + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT) + set(_boost_CHECKED_COMPONENT TRUE) + if(NOT Boost_${COMPONENT}_FOUND) + string(TOLOWER ${COMPONENT} COMPONENT) + list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) + endif() + endforeach() + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") + endif() + + if (_Boost_MISSING_COMPONENTS) + set(Boost_FOUND 0) + # We were unable to find some libraries, so generate a sensible + # error message that lists the libraries we were unable to find. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nCould not find the following") + if(Boost_USE_STATIC_LIBS) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON} static") + endif() + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON} Boost libraries:\n") + foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON} ${Boost_NAMESPACE}_${COMPONENT}\n") + endforeach() + + list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) + list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) + if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + else () + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + endif () + endif () + + if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + # Compatibility Code for backwards compatibility with CMake + # 2.4's FindBoost module. + + # Look for the boost library path. + # Note that the user may not have installed any libraries + # so it is quite possible the Boost_LIBRARY_DIRS may not exist. + set(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) + + if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") + get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + endif() + + if("${_boost_LIB_DIR}" MATCHES "/include$") + # Strip off the trailing "/include" in the path. + get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + endif() + + if(EXISTS "${_boost_LIB_DIR}/lib") + set(_boost_LIB_DIR ${_boost_LIB_DIR}/lib) + else() + if(EXISTS "${_boost_LIB_DIR}/stage/lib") + set(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) + else() + set(_boost_LIB_DIR "") + endif() + endif() + + if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR}) + endif() + + endif() +else() + # Boost headers were not found so no components were found. + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + set(Boost_${UPPERCOMPONENT}_FOUND 0) + endforeach() +endif() + +# ------------------------------------------------------------------------ +# Notification to end user about what was found +# ------------------------------------------------------------------------ + +set(Boost_LIBRARIES "") +if(Boost_FOUND) + if(NOT Boost_FIND_QUIETLY) + message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + if(Boost_FIND_COMPONENTS) + message(STATUS "Found the following Boost libraries:") + endif() + endif() + foreach( COMPONENT ${Boost_FIND_COMPONENTS} ) + string( TOUPPER ${COMPONENT} UPPERCOMPONENT ) + if( Boost_${UPPERCOMPONENT}_FOUND ) + if(NOT Boost_FIND_QUIETLY) + message (STATUS " ${COMPONENT}") + endif() + list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY}) + endif() + endforeach() +else() + if(Boost_FIND_REQUIRED) + message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") + else() + if(NOT Boost_FIND_QUIETLY) + # we opt not to automatically output Boost_ERROR_REASON here as + # it could be quite lengthy and somewhat imposing in its requests + # Since Boost is not always a required dependency we'll leave this + # up to the end-user. + if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) + message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}") + else() + message(STATUS "Could NOT find Boost") + endif() + endif() + endif() +endif() + +# Configure display of cache entries in GUI. +foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB}) + get_property(_type CACHE ${v} PROPERTY TYPE) + if(_type) + set_property(CACHE ${v} PROPERTY ADVANCED 1) + if("x${_type}" STREQUAL "xUNINITIALIZED") + if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS") + set_property(CACHE ${v} PROPERTY TYPE STRING) + else() + set_property(CACHE ${v} PROPERTY TYPE PATH) + endif() + endif() + endif() +endforeach() + +# Record last used values of input variables so we can +# detect on the next run if the user changed them. +foreach(v + ${_Boost_VARS_INC} ${_Boost_VARS_LIB} + ${_Boost_VARS_DIR} ${_Boost_VARS_NAME} + ) + if(DEFINED ${v}) + set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.") + else() + unset(_${v}_LAST CACHE) + endif() +endforeach() + +# Maintain a persistent list of components requested anywhere since +# the last flush. +set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}") +list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS}) +list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED) +list(SORT _Boost_COMPONENTS_SEARCHED) +set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}" + CACHE INTERNAL "Components requested for this build tree.") From 2a4d70cc1a9da59ef67238bc956cab62a8ed7dd7 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 25 Jan 2020 09:00:34 +0100 Subject: [PATCH 11/33] Fix iOS build, set install target --- .../Boost/schemes/url_sha1_boost_ios_library.cmake.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index 88c7206484..fc12813a28 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -213,6 +213,8 @@ if(has_iphoneos) ./b2 ${verbose_output} ${build_opts_iphoneos} + install + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" BUILD_IN_SOURCE 1 INSTALL_COMMAND @@ -266,6 +268,8 @@ if(has_isim) ./b2 ${verbose_output} ${build_opts_iphonesimulator} + install + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" BUILD_IN_SOURCE 1 INSTALL_COMMAND From 2f22dbed16da2c9b14f9c81ee37964bfaad5c5a4 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 25 Jan 2020 11:31:56 +0100 Subject: [PATCH 12/33] Split build and install target on iOS build --- .../schemes/url_sha1_boost_ios_library.cmake.in | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index fc12813a28..d4a3727d15 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -213,12 +213,14 @@ if(has_iphoneos) ./b2 ${verbose_output} ${build_opts_iphoneos} - install - "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" BUILD_IN_SOURCE 1 INSTALL_COMMAND - "" + ./b2 + -d0 + ${build_opts_iphoneos} + install + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" ) else() # Add dummy target @@ -268,12 +270,14 @@ if(has_isim) ./b2 ${verbose_output} ${build_opts_iphonesimulator} - install - "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" BUILD_IN_SOURCE 1 INSTALL_COMMAND - "" + ./b2 + -d0 + ${build_opts_iphonesimulator} + install + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" ) else() # Add dummy target From 37bcbd50efdee6d48b959fa66b8a6ae02b7986ca Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 1 Feb 2020 09:09:08 +0100 Subject: [PATCH 13/33] Enable boost debug --- examples/Boost/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index 8ccbd97a57..30703b9ea6 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate include("../common.cmake") From 33cb8cdc386dfac2e822835cd5030f1aa92a688f Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 1 Feb 2020 09:53:07 +0100 Subject: [PATCH 14/33] Use Boost::boost because example is build also with older versions --- examples/Boost/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index 30703b9ea6..6a58c36ba1 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -19,7 +19,7 @@ set(Boost_USE_STATIC_LIBS ON) find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::headers) +target_link_libraries(foo PUBLIC Boost::boost) # In since boost 1.70 you should use Boost::headers as target set(project_license "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") file( From c14fc474524bac26ccc9af49e45b89c1c4db7cb5 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sat, 1 Feb 2020 09:53:28 +0100 Subject: [PATCH 15/33] Comment out fix, needs impovement --- .../projects/Boost/schemes/url_sha1_boost_library.cmake.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index cea5f09de4..1daeab55c4 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -218,7 +218,9 @@ if(has_toolset_version) endif() set(boost_user_jam "@HUNTER_PACKAGE_BUILD_DIR@/boost.user.jam") -file(TO_NATIVE_PATH "${boost_user_jam}" boost_user_jam_native_path) +# TODO file(TO_NATIVE_PATH "${boost_user_jam}" boost_user_jam_native_path) +# Escape --user-config=C:\projects\hunter-tdmm2\_testing\Hunter\_Base\5398c9d\30f4075\2d24521\Build\Boost\__filesystem\Build\boost.user.jam +# Error -> Invalid character escape '\p'. set( build_opts -a @@ -227,7 +229,7 @@ set( ${variants} --layout=tagged toolset=${toolset_full_name} - "--user-config=${boost_user_jam_native_path}" + "--user-config=${boost_user_jam}" --with-@HUNTER_PACKAGE_COMPONENT@ ) if("@MINGW@") From 076b5103f1d5865e0ec048e96fc7b7971a520953 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 3 Feb 2020 08:55:12 +0100 Subject: [PATCH 16/33] Fix mingw/boost 1.64 test build --- examples/Boost-chrono-1-64/CMakeLists.txt | 23 +++++++ examples/Boost-chrono-1-64/foo.cpp | 6 ++ examples/Boost-filesystem-1-64/CMakeLists.txt | 60 +++++++++++++++++++ examples/Boost-filesystem-1-64/foo.cpp | 7 +++ .../Boost-filesystem-1-64/foo_android.cpp | 21 +++++++ examples/Boost-thread-1-64/CMakeLists.txt | 16 +++++ examples/Boost-thread-1-64/foo.cpp | 36 +++++++++++ 7 files changed, 169 insertions(+) create mode 100644 examples/Boost-chrono-1-64/CMakeLists.txt create mode 100644 examples/Boost-chrono-1-64/foo.cpp create mode 100644 examples/Boost-filesystem-1-64/CMakeLists.txt create mode 100644 examples/Boost-filesystem-1-64/foo.cpp create mode 100644 examples/Boost-filesystem-1-64/foo_android.cpp create mode 100644 examples/Boost-thread-1-64/CMakeLists.txt create mode 100644 examples/Boost-thread-1-64/foo.cpp diff --git a/examples/Boost-chrono-1-64/CMakeLists.txt b/examples/Boost-chrono-1-64/CMakeLists.txt new file mode 100644 index 0000000000..9b5a8dadd5 --- /dev/null +++ b/examples/Boost-chrono-1-64/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +hunter_add_package(Boost COMPONENTS system chrono) +find_package(Boost CONFIG REQUIRED system chrono) + +add_executable(foo foo.cpp) +target_link_libraries( + foo + PUBLIC + Boost::chrono + Boost::system # Should be last + # Boost 1.66.0, Linux, Clang with -stdlib=libstdc++: + # * https://travis-ci.org/ingenue/hunter/jobs/318140468#L2651 +) diff --git a/examples/Boost-chrono-1-64/foo.cpp b/examples/Boost-chrono-1-64/foo.cpp new file mode 100644 index 0000000000..33c0516210 --- /dev/null +++ b/examples/Boost-chrono-1-64/foo.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + boost::chrono::system_clock::now(); + return 0; +} diff --git a/examples/Boost-filesystem-1-64/CMakeLists.txt b/examples/Boost-filesystem-1-64/CMakeLists.txt new file mode 100644 index 0000000000..6339e56979 --- /dev/null +++ b/examples/Boost-filesystem-1-64/CMakeLists.txt @@ -0,0 +1,60 @@ +# Copyright (c) 2013-2015, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +# download boost +hunter_add_package(Boost COMPONENTS system filesystem) + +# now boost can be used +find_package(Boost CONFIG REQUIRED system filesystem) + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_ANDROID_NDK}" "" is_empty) + if(is_empty) + message(FATAL_ERROR "CMAKE_ANDROID_NDK is empty") + endif() + add_library( + foo + SHARED + foo_android.cpp + "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c" + ) +else() + add_executable(foo foo.cpp) +endif() + +target_link_libraries(foo Boost::system Boost::filesystem) + +if(ANDROID) + target_link_libraries(foo log android) + target_include_directories( + foo PUBLIC "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue" + ) + + if(NOT "$ENV{TRAVIS}") + # Travis CI failed builds: + # * https://travis-ci.org/ingenue/hunter/jobs/106905844 + # * https://travis-ci.org/ingenue/hunter/jobs/106905851 + hunter_add_package(Android-Apk) + list(APPEND CMAKE_MODULE_PATH "${ANDROID-APK_ROOT}") + include(AndroidApk) + + hunter_add_package(Android-SDK) + message("Path to `android`: ${ANDROID-SDK_ROOT}/android-sdk/tools/android") + message("Path to `emulator`: ${ANDROID-SDK_ROOT}/android-sdk/tools/emulator") + message("Path to `adb`: ${ANDROID-SDK_ROOT}/android-sdk/platform-tools/adb") + + android_create_apk( + BASE_TARGET foo + LAUNCH_TARGET foo-launch + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/apk" + ) + endif() +endif() diff --git a/examples/Boost-filesystem-1-64/foo.cpp b/examples/Boost-filesystem-1-64/foo.cpp new file mode 100644 index 0000000000..13f5f90676 --- /dev/null +++ b/examples/Boost-filesystem-1-64/foo.cpp @@ -0,0 +1,7 @@ +#include +#include // std::cout + +int main() { + namespace fs = boost::filesystem; + std::cout << "Current path: " << fs::current_path() << std::endl; +} diff --git a/examples/Boost-filesystem-1-64/foo_android.cpp b/examples/Boost-filesystem-1-64/foo_android.cpp new file mode 100644 index 0000000000..b86604683d --- /dev/null +++ b/examples/Boost-filesystem-1-64/foo_android.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2015, Ruslan Baratov +// All rights reserved. + +#include + +#include +#include + +void android_main(struct android_app* state) { + app_dummy(); // Make sure glue isn't stripped + + namespace fs = boost::filesystem; + + __android_log_print( + ANDROID_LOG_INFO, + "BoostFilesystemExample", + fs::current_path().c_str() + ); + + ANativeActivity_finish(state->activity); +} diff --git a/examples/Boost-thread-1-64/CMakeLists.txt b/examples/Boost-thread-1-64/CMakeLists.txt new file mode 100644 index 0000000000..cdb4d19a80 --- /dev/null +++ b/examples/Boost-thread-1-64/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +hunter_add_package(Boost COMPONENTS system thread) +find_package(Boost CONFIG REQUIRED system thread) + +add_executable(foo foo.cpp) +target_link_libraries(foo PUBLIC Boost::system Boost::thread) diff --git a/examples/Boost-thread-1-64/foo.cpp b/examples/Boost-thread-1-64/foo.cpp new file mode 100644 index 0000000000..811dcb8b0b --- /dev/null +++ b/examples/Boost-thread-1-64/foo.cpp @@ -0,0 +1,36 @@ +#ifndef BOOST_THREAD_PROVIDES_FUTURE +#define BOOST_THREAD_PROVIDES_FUTURE +#endif +// #ifndef BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION +// #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION +// #endif +// #ifndef BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY +// #define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY +// #endif + + +#include +#include + + +int calculate_the_answer_to_life_the_universe_and_everything() +{ + return 42; +} + + + +int main() { + boost::packaged_task pt(calculate_the_answer_to_life_the_universe_and_everything); + boost:: future fi=pt.get_future(); + + boost::thread task(boost::move(pt)); // launch task on a thread + + fi.wait(); // wait for it to finish + + assert(fi.is_ready()); + assert(fi.has_value()); + assert(!fi.has_exception()); + assert(fi.get_state()==boost::future_state::ready); + assert(fi.get()==42); +} From e2978c8a669e1266301ce6339d71faa5e5d0b973 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 3 Feb 2020 08:56:42 +0100 Subject: [PATCH 17/33] Fix vs builds --- examples/Boost-python-numpy/CMakeLists.txt | 3 +++ examples/Boost-python/CMakeLists.txt | 3 +++ examples/Boost-system/CMakeLists.txt | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/examples/Boost-python-numpy/CMakeLists.txt b/examples/Boost-python-numpy/CMakeLists.txt index e82eacd728..a80f04e3e4 100644 --- a/examples/Boost-python-numpy/CMakeLists.txt +++ b/examples/Boost-python-numpy/CMakeLists.txt @@ -17,6 +17,9 @@ project(download-boost) # Requires python version 3.5. Change this in config.cmake if necessary. hunter_add_package(Boost COMPONENTS python) + +# default on Windows is static, set Boost_USE_STATIC_LIBS=OFF to override +set(Boost_USE_STATIC_LIBS OFF) find_package(Boost CONFIG REQUIRED python35 numpy35) # pip_numpy must come before we find Python as it enables the virtualenv diff --git a/examples/Boost-python/CMakeLists.txt b/examples/Boost-python/CMakeLists.txt index dd439a790a..d270298070 100644 --- a/examples/Boost-python/CMakeLists.txt +++ b/examples/Boost-python/CMakeLists.txt @@ -19,6 +19,9 @@ project(download-boost) # Requires python version 3.5. Change this in config.cmake if necessary. hunter_add_package(Boost COMPONENTS python) + +# default on Windows is static, set Boost_USE_STATIC_LIBS=OFF to override +set(Boost_USE_STATIC_LIBS OFF) find_package(Boost CONFIG REQUIRED python35) find_package(PythonLibs ${PYTHON_VERSION} EXACT REQUIRED) diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index 3f5929edea..7ac231201b 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -16,6 +16,13 @@ hunter_add_package(Boost COMPONENTS system) # This is important because Hunter build only boost as a static library by default! set(Boost_USE_STATIC_LIBS ON) +if(MSVC) + # See cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in line 205. If BOOST_BUILD_DYNAMIC_VSRUNTIME is true, boost is build with runtime-link=static + # It is set when see cmake/projects/Boost/hunter.cmake line 415 + hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) + set(Boost_USE_STATIC_RUNTIME ${_hunter_vs_md}) +endif() + find_package(Boost CONFIG REQUIRED system) add_executable(foo foo.cpp) From c1752ceb9dcabe99889320621ff32df38be2bafd Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 3 Feb 2020 08:57:02 +0100 Subject: [PATCH 18/33] Cleanup boost thread test build --- examples/Boost-thread/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Boost-thread/CMakeLists.txt b/examples/Boost-thread/CMakeLists.txt index a17a2fbf0b..74b2d52438 100644 --- a/examples/Boost-thread/CMakeLists.txt +++ b/examples/Boost-thread/CMakeLists.txt @@ -11,12 +11,12 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS system thread) +hunter_add_package(Boost COMPONENTS thread) # This is important because Hunter build only boost as a static library by default! set(Boost_USE_STATIC_LIBS ON) -find_package(Boost CONFIG REQUIRED system thread) +find_package(Boost CONFIG REQUIRED thread) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::thread) From 3588138ff5f179b49bc8536aec1a70d30edb3c1e Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 4 Feb 2020 06:09:10 +0100 Subject: [PATCH 19/33] Fix boost system test on windows --- examples/Boost-system/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index 7ac231201b..610b4778b7 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -20,7 +20,11 @@ if(MSVC) # See cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in line 205. If BOOST_BUILD_DYNAMIC_VSRUNTIME is true, boost is build with runtime-link=static # It is set when see cmake/projects/Boost/hunter.cmake line 415 hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) - set(Boost_USE_STATIC_RUNTIME ${_hunter_vs_md}) + if(_hunter_vs_md) + set(Boost_USE_STATIC_RUNTIME OFF) + else() + set(Boost_USE_STATIC_RUNTIME ON) + endif() endif() find_package(Boost CONFIG REQUIRED system) From 730d52651180c953e53bd176bdc6312594d5381a Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 4 Feb 2020 06:47:04 +0100 Subject: [PATCH 20/33] Improve boost log test --- examples/Boost-log-shared/CMakeLists.txt | 21 +++++++++++---------- examples/Boost-log/CMakeLists.txt | 7 +++++++ examples/Boost-log/foo.cpp | 10 +++++++++- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/examples/Boost-log-shared/CMakeLists.txt b/examples/Boost-log-shared/CMakeLists.txt index a1227604b5..c6f5e58f6d 100644 --- a/examples/Boost-log-shared/CMakeLists.txt +++ b/examples/Boost-log-shared/CMakeLists.txt @@ -3,26 +3,27 @@ cmake_minimum_required(VERSION 3.0) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Emulate HunterGate: # * https://github.com/hunter-packages/gate set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) #set BUILD_SHARED_LIBS=ON include("../common.cmake") project(download-boost) +include(CMakePrintHelpers) -hunter_add_package(Boost COMPONENTS log filesystem system chrono thread regex date_time atomic) -find_package(Boost CONFIG REQUIRED log filesystem system chrono thread regex date_time atomic) +hunter_add_package(Boost COMPONENTS log) +find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::log - Boost::filesystem - Boost::system - Boost::chrono - Boost::thread - Boost::regex - Boost::date_time - Boost::atomic - Boost::boost ) + +cmake_print_variables(Boost_VERSION_STRING) +cmake_print_properties( + TARGETS Boost::log + PROPERTIES INTERFACE_LINK_LIBRARIES +) \ No newline at end of file diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index 2e33f97fec..c729558bcf 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -10,6 +10,7 @@ set(Boost_DEBUG ON CACHE BOOLEAN "") include("../common.cmake") project(download-boost) +include(CMakePrintHelpers) hunter_add_package(Boost COMPONENTS log) @@ -20,3 +21,9 @@ find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::log) + +cmake_print_variables(Boost_VERSION_STRING) +cmake_print_properties( + TARGETS Boost::log + PROPERTIES INTERFACE_LINK_LIBRARIES +) \ No newline at end of file diff --git a/examples/Boost-log/foo.cpp b/examples/Boost-log/foo.cpp index 75cfa01846..1f56b3f693 100644 --- a/examples/Boost-log/foo.cpp +++ b/examples/Boost-log/foo.cpp @@ -1,4 +1,12 @@ -#include +#include int main() { + BOOST_LOG_TRIVIAL(trace) << "A trace severity message"; + BOOST_LOG_TRIVIAL(debug) << "A debug severity message"; + BOOST_LOG_TRIVIAL(info) << "An informational severity message"; + BOOST_LOG_TRIVIAL(warning) << "A warning severity message"; + BOOST_LOG_TRIVIAL(error) << "An error severity message"; + BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message"; + + return 0; } From 65d3182a51b77086280977d6da52902dc6c05908 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sun, 9 Feb 2020 19:30:09 +0100 Subject: [PATCH 21/33] Set Boost_USE_STATIC_LIBS when not HUNTER_BUILD_SHARED_LIBS --- cmake/projects/Boost/hunter.cmake | 11 +++++++++++ examples/Boost-chrono/CMakeLists.txt | 4 ---- examples/Boost-contract/CMakeLists.txt | 4 ---- examples/Boost-fiber/CMakeLists.txt | 4 ---- examples/Boost-filesystem/CMakeLists.txt | 4 ---- examples/Boost-iostreams/CMakeLists.txt | 10 ++++------ examples/Boost-log/CMakeLists.txt | 4 ---- examples/Boost-math/CMakeLists.txt | 4 ---- examples/Boost-program-options/CMakeLists.txt | 4 ---- examples/Boost-python-numpy/CMakeLists.txt | 5 ++--- examples/Boost-python/CMakeLists.txt | 3 --- examples/Boost-random/CMakeLists.txt | 4 ---- examples/Boost-serialization/CMakeLists.txt | 4 ---- examples/Boost-stacktrace/CMakeLists.txt | 4 ---- examples/Boost-system/CMakeLists.txt | 15 --------------- examples/Boost-test/CMakeLists.txt | 4 ---- examples/Boost-thread/CMakeLists.txt | 4 ---- examples/Boost-uuid/CMakeLists.txt | 4 ---- examples/Boost/CMakeLists.txt | 4 ---- 19 files changed, 17 insertions(+), 83 deletions(-) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index 007fb9f697..f96bc9031a 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -418,8 +418,19 @@ if(MSVC) CMAKE_ARGS BOOST_BUILD_DYNAMIC_VSRUNTIME=${_hunter_vs_md} ) + if(_hunter_vs_md) + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" OFF) + else() + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" ON) + endif() endif() hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") + +if(HUNTER_BUILD_SHARED_LIBS) + option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) +else() + option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) +endif() diff --git a/examples/Boost-chrono/CMakeLists.txt b/examples/Boost-chrono/CMakeLists.txt index 26ab1d57d6..a6c968e1cb 100644 --- a/examples/Boost-chrono/CMakeLists.txt +++ b/examples/Boost-chrono/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS chrono) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED chrono) add_executable(foo foo.cpp) diff --git a/examples/Boost-contract/CMakeLists.txt b/examples/Boost-contract/CMakeLists.txt index 3d7047684c..9164c025c1 100644 --- a/examples/Boost-contract/CMakeLists.txt +++ b/examples/Boost-contract/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS system contract) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED system contract) add_executable(foo foo.cpp) diff --git a/examples/Boost-fiber/CMakeLists.txt b/examples/Boost-fiber/CMakeLists.txt index 0669a0ffd4..a2e913e9c1 100644 --- a/examples/Boost-fiber/CMakeLists.txt +++ b/examples/Boost-fiber/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS fiber) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED fiber) add_executable(foo foo.cpp) diff --git a/examples/Boost-filesystem/CMakeLists.txt b/examples/Boost-filesystem/CMakeLists.txt index aa8d71d2f1..9611e553e1 100644 --- a/examples/Boost-filesystem/CMakeLists.txt +++ b/examples/Boost-filesystem/CMakeLists.txt @@ -15,10 +15,6 @@ project(download-boost) hunter_add_package(Boost COMPONENTS filesystem) # now boost can be used - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED filesystem) if(ANDROID) diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index ef9febed77..7d3590596e 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -12,12 +12,10 @@ include("../common.cmake") project(boost_iostreams) hunter_add_package(Boost COMPONENTS iostreams serialization) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - -find_package(ZLIB CONFIG REQUIRED) # TODO(BJoe) Should required/include by boost::iostreams -find_package(BZip2 CONFIG REQUIRED) # TODO(BJoe) Should required/include by boost::iostreams +# If you use boost/iostreams/filter/gzip.hpp then you should add ZLIB +find_package(ZLIB CONFIG REQUIRED) +# If you use boost/iostreams/filter/bzip2.hpp then you should add BZip2 +find_package(BZip2 CONFIG REQUIRED) find_package(Boost CONFIG REQUIRED iostreams serialization) add_executable(foo foo.cpp) diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index c729558bcf..cef7f0c251 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -13,10 +13,6 @@ project(download-boost) include(CMakePrintHelpers) hunter_add_package(Boost COMPONENTS log) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) diff --git a/examples/Boost-math/CMakeLists.txt b/examples/Boost-math/CMakeLists.txt index f217db77ce..8a49ce8506 100644 --- a/examples/Boost-math/CMakeLists.txt +++ b/examples/Boost-math/CMakeLists.txt @@ -13,10 +13,6 @@ project(download-boost) # download boost hunter_add_package(Boost COMPONENTS math) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - # now boost::math_* targets # link in all the parts of boost math, or leave out unneeded parts find_package(Boost CONFIG REQUIRED math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) diff --git a/examples/Boost-program-options/CMakeLists.txt b/examples/Boost-program-options/CMakeLists.txt index 45283b8647..c8375c594e 100644 --- a/examples/Boost-program-options/CMakeLists.txt +++ b/examples/Boost-program-options/CMakeLists.txt @@ -12,8 +12,4 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS program_options) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED COMPONENTS program_options) diff --git a/examples/Boost-python-numpy/CMakeLists.txt b/examples/Boost-python-numpy/CMakeLists.txt index a80f04e3e4..df502caa30 100644 --- a/examples/Boost-python-numpy/CMakeLists.txt +++ b/examples/Boost-python-numpy/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.12) option(HUNTER_BUILD_SHARED_LIBS "..." ON) +set(Boost_DEBUG ON CACHE BOOLEAN "") + # Configure: set(PYTHON_VERSION 3.5) set(TESTING_CONFIG_OPT FILEPATH "${CMAKE_CURRENT_LIST_DIR}/config.cmake") @@ -17,9 +19,6 @@ project(download-boost) # Requires python version 3.5. Change this in config.cmake if necessary. hunter_add_package(Boost COMPONENTS python) - -# default on Windows is static, set Boost_USE_STATIC_LIBS=OFF to override -set(Boost_USE_STATIC_LIBS OFF) find_package(Boost CONFIG REQUIRED python35 numpy35) # pip_numpy must come before we find Python as it enables the virtualenv diff --git a/examples/Boost-python/CMakeLists.txt b/examples/Boost-python/CMakeLists.txt index d270298070..dd439a790a 100644 --- a/examples/Boost-python/CMakeLists.txt +++ b/examples/Boost-python/CMakeLists.txt @@ -19,9 +19,6 @@ project(download-boost) # Requires python version 3.5. Change this in config.cmake if necessary. hunter_add_package(Boost COMPONENTS python) - -# default on Windows is static, set Boost_USE_STATIC_LIBS=OFF to override -set(Boost_USE_STATIC_LIBS OFF) find_package(Boost CONFIG REQUIRED python35) find_package(PythonLibs ${PYTHON_VERSION} EXACT REQUIRED) diff --git a/examples/Boost-random/CMakeLists.txt b/examples/Boost-random/CMakeLists.txt index 9a8ad55636..70b56b530a 100644 --- a/examples/Boost-random/CMakeLists.txt +++ b/examples/Boost-random/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost-random) hunter_add_package(Boost COMPONENTS random) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED random) add_executable(foo foo.cpp) diff --git a/examples/Boost-serialization/CMakeLists.txt b/examples/Boost-serialization/CMakeLists.txt index f65d0f9016..e73204d557 100644 --- a/examples/Boost-serialization/CMakeLists.txt +++ b/examples/Boost-serialization/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS serialization) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED serialization) add_executable(foo foo.cpp) diff --git a/examples/Boost-stacktrace/CMakeLists.txt b/examples/Boost-stacktrace/CMakeLists.txt index 9da490425e..0bcace8efe 100644 --- a/examples/Boost-stacktrace/CMakeLists.txt +++ b/examples/Boost-stacktrace/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS stacktrace) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED stacktrace_backtrace) add_executable(foo foo.cpp) diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index 610b4778b7..2e125023bf 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -12,21 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS system) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - -if(MSVC) - # See cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in line 205. If BOOST_BUILD_DYNAMIC_VSRUNTIME is true, boost is build with runtime-link=static - # It is set when see cmake/projects/Boost/hunter.cmake line 415 - hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) - if(_hunter_vs_md) - set(Boost_USE_STATIC_RUNTIME OFF) - else() - set(Boost_USE_STATIC_RUNTIME ON) - endif() -endif() - find_package(Boost CONFIG REQUIRED system) add_executable(foo foo.cpp) diff --git a/examples/Boost-test/CMakeLists.txt b/examples/Boost-test/CMakeLists.txt index be00d07c0d..3fa14ce10d 100644 --- a/examples/Boost-test/CMakeLists.txt +++ b/examples/Boost-test/CMakeLists.txt @@ -12,8 +12,4 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS test) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED COMPONENTS unit_test_framework) diff --git a/examples/Boost-thread/CMakeLists.txt b/examples/Boost-thread/CMakeLists.txt index 74b2d52438..7a47bfe1fe 100644 --- a/examples/Boost-thread/CMakeLists.txt +++ b/examples/Boost-thread/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost COMPONENTS thread) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED thread) add_executable(foo foo.cpp) diff --git a/examples/Boost-uuid/CMakeLists.txt b/examples/Boost-uuid/CMakeLists.txt index 5eef48d824..fb131a17dc 100644 --- a/examples/Boost-uuid/CMakeLists.txt +++ b/examples/Boost-uuid/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index 6a58c36ba1..3bcb04af53 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -12,10 +12,6 @@ include("../common.cmake") project(download-boost) hunter_add_package(Boost) - -# This is important because Hunter build only boost as a static library by default! -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) From 6e3f71e5285769afd6d70961bd775016a11d1c12 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 10 Feb 2020 07:01:57 +0100 Subject: [PATCH 22/33] Get cmake args for Boost --- cmake/projects/Boost/hunter.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index f96bc9031a..f0c1009f14 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -429,7 +429,9 @@ hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") -if(HUNTER_BUILD_SHARED_LIBS) +hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) +string(REGEX REPLACE "BUILD_SHARED_LIBS=ON" "ON" boost_shared "${boost_cmake_args}") +if(boost_shared) option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) else() option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) From 957ecabb6b1c06c154840d21f6dbd48a8e8ca6d4 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 10 Feb 2020 09:28:09 +0100 Subject: [PATCH 23/33] Fix use boost static libs in windows --- cmake/projects/Boost/hunter.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index f0c1009f14..59932a1da0 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -430,9 +430,9 @@ hunter_cacheable(Boost) hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) -string(REGEX REPLACE "BUILD_SHARED_LIBS=ON" "ON" boost_shared "${boost_cmake_args}") -if(boost_shared) - option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) -else() +string(FIND "${boost_cmake_args}" "BUILD_SHARED_LIBS=ON" boost_shared) +if(boost_shared LESS 0) option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) +else() + option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) endif() From 92ada88a140e31c80174417ca327d291a833d197 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 11 Feb 2020 08:24:31 +0100 Subject: [PATCH 24/33] Introduced USE_CONFIG_FROM_BOOST --- cmake/projects/Boost/hunter.cmake | 28 ++++++++++++------- .../Boost/schemes/url_sha1_boost.cmake.in | 2 +- .../url_sha1_boost_ios_library.cmake.in | 2 +- .../schemes/url_sha1_boost_library.cmake.in | 2 +- examples/Boost-chrono/CMakeLists.txt | 1 + examples/Boost-chrono/config.cmake | 4 +++ examples/Boost-contract/CMakeLists.txt | 1 + examples/Boost-contract/config.cmake | 4 +++ examples/Boost-fiber/CMakeLists.txt | 1 + examples/Boost-fiber/config.cmake | 4 +++ examples/Boost-filesystem-shared/config.cmake | 2 +- examples/Boost-filesystem/CMakeLists.txt | 1 + examples/Boost-filesystem/config.cmake | 4 +++ examples/Boost-iostreams/CMakeLists.txt | 1 + examples/Boost-iostreams/config.cmake | 4 +++ examples/Boost-log-shared/config.cmake | 2 +- examples/Boost-log/CMakeLists.txt | 1 + examples/Boost-log/config.cmake | 4 +++ examples/Boost-math/CMakeLists.txt | 1 + examples/Boost-math/config.cmake | 4 +++ examples/Boost-program-options/CMakeLists.txt | 1 + examples/Boost-program-options/config.cmake | 4 +++ examples/Boost-python-numpy/config.cmake | 2 +- examples/Boost-python/config.cmake | 2 +- examples/Boost-random/CMakeLists.txt | 1 + examples/Boost-random/config.cmake | 4 +++ examples/Boost-serialization/CMakeLists.txt | 1 + examples/Boost-serialization/config.cmake | 4 +++ examples/Boost-stacktrace/CMakeLists.txt | 1 + examples/Boost-stacktrace/config.cmake | 4 +++ examples/Boost-system/CMakeLists.txt | 1 + examples/Boost-system/config.cmake | 4 +++ examples/Boost-test/CMakeLists.txt | 1 + examples/Boost-test/config.cmake | 4 +++ examples/Boost-thread/CMakeLists.txt | 1 + examples/Boost-thread/config.cmake | 4 +++ examples/Boost-uuid/CMakeLists.txt | 1 + examples/Boost-uuid/config.cmake | 4 +++ examples/Boost/CMakeLists.txt | 1 + examples/Boost/config.cmake | 4 +++ 40 files changed, 105 insertions(+), 17 deletions(-) create mode 100644 examples/Boost-chrono/config.cmake create mode 100644 examples/Boost-contract/config.cmake create mode 100644 examples/Boost-fiber/config.cmake create mode 100644 examples/Boost-filesystem/config.cmake create mode 100644 examples/Boost-iostreams/config.cmake create mode 100644 examples/Boost-log/config.cmake create mode 100644 examples/Boost-math/config.cmake create mode 100644 examples/Boost-program-options/config.cmake create mode 100644 examples/Boost-random/config.cmake create mode 100644 examples/Boost-serialization/config.cmake create mode 100644 examples/Boost-stacktrace/config.cmake create mode 100644 examples/Boost-system/config.cmake create mode 100644 examples/Boost-test/config.cmake create mode 100644 examples/Boost-thread/config.cmake create mode 100644 examples/Boost-uuid/config.cmake create mode 100644 examples/Boost/config.cmake diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index 59932a1da0..6e431e80c6 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -418,21 +418,29 @@ if(MSVC) CMAKE_ARGS BOOST_BUILD_DYNAMIC_VSRUNTIME=${_hunter_vs_md} ) - if(_hunter_vs_md) - option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" OFF) - else() - option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" ON) - endif() endif() hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") + hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) string(FIND "${boost_cmake_args}" "BUILD_SHARED_LIBS=ON" boost_shared) -if(boost_shared LESS 0) - option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) -else() - option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) -endif() +string(FIND "${boost_cmake_args}" "USE_CONFIG_FROM_BOOST=ON" use_boost_config) +string(FIND "${boost_cmake_args}" "BOOST_BUILD_DYNAMIC_VSRUNTIME=ON" boost_static_runtime) +if(use_boost_config GREATER -1) + if(boost_shared LESS 0) + option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) + else() + option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) + endif() + + if(MSVC) + if(boost_static_runtime LESS 0) + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" OFF) + else() + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" ON) + endif() + endif() +endif() \ No newline at end of file diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index e32685181b..70129afb61 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -154,6 +154,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) +if(NOT USE_CONFIG_FROM_BOOST) hunter_install_boost_config() endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index d4a3727d15..4f4236a2cd 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -380,6 +380,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) +if(NOT USE_CONFIG_FROM_BOOST) hunter_install_boost_config() endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 1daeab55c4..44cfe626bf 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -534,6 +534,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(HUNTER_Boost_VERSION VERSION_LESS 1.72.0) +if(NOT USE_CONFIG_FROM_BOOST) hunter_install_boost_config() endif() diff --git a/examples/Boost-chrono/CMakeLists.txt b/examples/Boost-chrono/CMakeLists.txt index a6c968e1cb..6ba8ec001b 100644 --- a/examples/Boost-chrono/CMakeLists.txt +++ b/examples/Boost-chrono/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-chrono/config.cmake b/examples/Boost-chrono/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-chrono/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-contract/CMakeLists.txt b/examples/Boost-contract/CMakeLists.txt index 9164c025c1..7c7acc0c03 100644 --- a/examples/Boost-contract/CMakeLists.txt +++ b/examples/Boost-contract/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-contract/config.cmake b/examples/Boost-contract/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-contract/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-fiber/CMakeLists.txt b/examples/Boost-fiber/CMakeLists.txt index a2e913e9c1..765aad205e 100644 --- a/examples/Boost-fiber/CMakeLists.txt +++ b/examples/Boost-fiber/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-fiber/config.cmake b/examples/Boost-fiber/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-fiber/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-filesystem-shared/config.cmake b/examples/Boost-filesystem-shared/config.cmake index 0bf7053a2f..f9ab533253 100644 --- a/examples/Boost-filesystem-shared/config.cmake +++ b/examples/Boost-filesystem-shared/config.cmake @@ -1,4 +1,4 @@ hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS BUILD_SHARED_LIBS=ON + CMAKE_ARGS BUILD_SHARED_LIBS=ON USE_CONFIG_FROM_BOOST=ON ) diff --git a/examples/Boost-filesystem/CMakeLists.txt b/examples/Boost-filesystem/CMakeLists.txt index 9611e553e1..9bb5b74ced 100644 --- a/examples/Boost-filesystem/CMakeLists.txt +++ b/examples/Boost-filesystem/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-filesystem/config.cmake b/examples/Boost-filesystem/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-filesystem/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index 7d3590596e..f817e0c1ee 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-iostreams/config.cmake b/examples/Boost-iostreams/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-iostreams/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-log-shared/config.cmake b/examples/Boost-log-shared/config.cmake index 0bf7053a2f..f9ab533253 100644 --- a/examples/Boost-log-shared/config.cmake +++ b/examples/Boost-log-shared/config.cmake @@ -1,4 +1,4 @@ hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS BUILD_SHARED_LIBS=ON + CMAKE_ARGS BUILD_SHARED_LIBS=ON USE_CONFIG_FROM_BOOST=ON ) diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index cef7f0c251..6d0dac0ad3 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-log/config.cmake b/examples/Boost-log/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-log/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-math/CMakeLists.txt b/examples/Boost-math/CMakeLists.txt index 8a49ce8506..95a72ae238 100644 --- a/examples/Boost-math/CMakeLists.txt +++ b/examples/Boost-math/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-math/config.cmake b/examples/Boost-math/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-math/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-program-options/CMakeLists.txt b/examples/Boost-program-options/CMakeLists.txt index c8375c594e..bd1453e390 100644 --- a/examples/Boost-program-options/CMakeLists.txt +++ b/examples/Boost-program-options/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-program-options/config.cmake b/examples/Boost-program-options/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-program-options/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-python-numpy/config.cmake b/examples/Boost-python-numpy/config.cmake index dbc2733f06..9fbef33c61 100644 --- a/examples/Boost-python-numpy/config.cmake +++ b/examples/Boost-python-numpy/config.cmake @@ -1,4 +1,4 @@ # Note: PYTHON_VERSION is optional. Refer to Boost package documentation on how # and when to use it: https://cpp-pm-hunter.readthedocs.io/en/latest/packages/pkg/Boost.html#cmake-options -hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} HUNTER_ENABLE_BOOST_PYTHON_NUMPY=True) +hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} HUNTER_ENABLE_BOOST_PYTHON_NUMPY=True USE_CONFIG_FROM_BOOST=ON) hunter_config(hunter_venv VERSION ${HUNTER_hunter_venv_VERSION} CMAKE_ARGS HUNTER_VENV_PYTHON_VERSION=${PYTHON_VERSION}) diff --git a/examples/Boost-python/config.cmake b/examples/Boost-python/config.cmake index fa638c3ec9..d02dee4459 100644 --- a/examples/Boost-python/config.cmake +++ b/examples/Boost-python/config.cmake @@ -1,3 +1,3 @@ # Note: PYTHON_VERSION is optional. Refer to Boost package documentation on how # and when to use it: https://hunter.readthedocs.io/en/latest/packages/pkg/Boost.html#cmake-options -hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION}) +hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} USE_CONFIG_FROM_BOOST=ON) diff --git a/examples/Boost-random/CMakeLists.txt b/examples/Boost-random/CMakeLists.txt index 70b56b530a..485c608aac 100644 --- a/examples/Boost-random/CMakeLists.txt +++ b/examples/Boost-random/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-random/config.cmake b/examples/Boost-random/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-random/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-serialization/CMakeLists.txt b/examples/Boost-serialization/CMakeLists.txt index e73204d557..c691919149 100644 --- a/examples/Boost-serialization/CMakeLists.txt +++ b/examples/Boost-serialization/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-serialization/config.cmake b/examples/Boost-serialization/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-serialization/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-stacktrace/CMakeLists.txt b/examples/Boost-stacktrace/CMakeLists.txt index 0bcace8efe..37aab3759b 100644 --- a/examples/Boost-stacktrace/CMakeLists.txt +++ b/examples/Boost-stacktrace/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.2) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-stacktrace/config.cmake b/examples/Boost-stacktrace/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-stacktrace/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index 2e125023bf..1256892eb5 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-system/config.cmake b/examples/Boost-system/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-system/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-test/CMakeLists.txt b/examples/Boost-test/CMakeLists.txt index 3fa14ce10d..a342f07083 100644 --- a/examples/Boost-test/CMakeLists.txt +++ b/examples/Boost-test/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-test/config.cmake b/examples/Boost-test/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-test/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-thread/CMakeLists.txt b/examples/Boost-thread/CMakeLists.txt index 7a47bfe1fe..5dd678befe 100644 --- a/examples/Boost-thread/CMakeLists.txt +++ b/examples/Boost-thread/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-thread/config.cmake b/examples/Boost-thread/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-thread/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost-uuid/CMakeLists.txt b/examples/Boost-uuid/CMakeLists.txt index fb131a17dc..0e20b6cffc 100644 --- a/examples/Boost-uuid/CMakeLists.txt +++ b/examples/Boost-uuid/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-uuid/config.cmake b/examples/Boost-uuid/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost-uuid/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index 3bcb04af53..edc674f582 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost/config.cmake b/examples/Boost/config.cmake new file mode 100644 index 0000000000..9daa4a1d95 --- /dev/null +++ b/examples/Boost/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON +) From 7b0d37099a58df459f5a6a9784895dbb174fe41c Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 11 Feb 2020 13:01:16 +0100 Subject: [PATCH 25/33] use boost config if not boost version less then 1.72 --- cmake/projects/Boost/schemes/url_sha1_boost.cmake.in | 2 +- .../projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in | 2 +- cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index 70129afb61..62d807b9ab 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -154,6 +154,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(NOT USE_CONFIG_FROM_BOOST) +if(NOT USE_CONFIG_FROM_BOOST OR HUNTER_Boost_VERSION VERSION_LESS 1.72.0) hunter_install_boost_config() endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index 4f4236a2cd..3ae0de7d26 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -380,6 +380,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(NOT USE_CONFIG_FROM_BOOST) +if(NOT USE_CONFIG_FROM_BOOST OR HUNTER_Boost_VERSION VERSION_LESS 1.72.0) hunter_install_boost_config() endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 44cfe626bf..bc3faf858e 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -534,6 +534,6 @@ set(HUNTER_SELF "@HUNTER_SELF@") set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") set(HUNTER_Boost_VERSION "@HUNTER_Boost_VERSION@") -if(NOT USE_CONFIG_FROM_BOOST) +if(NOT USE_CONFIG_FROM_BOOST OR HUNTER_Boost_VERSION VERSION_LESS 1.72.0) hunter_install_boost_config() endif() From 54d61b0617d3d6d24f2f966d6e5de601bc77993a Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 11 Feb 2020 13:07:49 +0100 Subject: [PATCH 26/33] If boost version should be 1.72 or greater --- cmake/projects/Boost/hunter.cmake | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index 6e431e80c6..591867f087 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -425,22 +425,24 @@ hunter_cacheable(Boost) hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") -hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) -string(FIND "${boost_cmake_args}" "BUILD_SHARED_LIBS=ON" boost_shared) -string(FIND "${boost_cmake_args}" "USE_CONFIG_FROM_BOOST=ON" use_boost_config) -string(FIND "${boost_cmake_args}" "BOOST_BUILD_DYNAMIC_VSRUNTIME=ON" boost_static_runtime) -if(use_boost_config GREATER -1) - if(boost_shared LESS 0) - option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) - else() - option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) - endif() - - if(MSVC) - if(boost_static_runtime LESS 0) - option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" OFF) +if(NOT HUNTER_Boost_VERSION VERSION_LESS 1.72.0) + hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) + string(FIND "${boost_cmake_args}" "BUILD_SHARED_LIBS=ON" boost_shared) + string(FIND "${boost_cmake_args}" "USE_CONFIG_FROM_BOOST=ON" use_boost_config) + string(FIND "${boost_cmake_args}" "BOOST_BUILD_DYNAMIC_VSRUNTIME=ON" boost_static_runtime) + if(use_boost_config GREATER -1) + if(boost_shared LESS 0) + option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) else() - option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" ON) + option(Boost_USE_STATIC_LIBS "Use of the static libraries" OFF) + endif() + + if(MSVC) + if(boost_static_runtime LESS 0) + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" OFF) + else() + option(Boost_USE_STATIC_RUNTIME "Use libraries linked statically to the C++ runtime" ON) + endif() + endif() endif() - endif() endif() \ No newline at end of file From 42ecac99bd8a19d237f3aaa5b8eea4ba3ba16fca Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 12 Feb 2020 06:31:33 +0100 Subject: [PATCH 27/33] if not BOOST_BUILD_DYNAMIC_VSRUNTIME use boost static runtime --- cmake/projects/Boost/hunter.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index 591867f087..e96afb6ff6 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -429,7 +429,7 @@ if(NOT HUNTER_Boost_VERSION VERSION_LESS 1.72.0) hunter_get_cmake_args(PACKAGE Boost OUT boost_cmake_args) string(FIND "${boost_cmake_args}" "BUILD_SHARED_LIBS=ON" boost_shared) string(FIND "${boost_cmake_args}" "USE_CONFIG_FROM_BOOST=ON" use_boost_config) - string(FIND "${boost_cmake_args}" "BOOST_BUILD_DYNAMIC_VSRUNTIME=ON" boost_static_runtime) + string(FIND "${boost_cmake_args}" "BOOST_BUILD_DYNAMIC_VSRUNTIME=NO" boost_static_runtime) if(use_boost_config GREATER -1) if(boost_shared LESS 0) option(Boost_USE_STATIC_LIBS "Use of the static libraries" ON) From 30882c2ca42f53bd9e95cbc1ca2147789633b336 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Thu, 13 Feb 2020 09:34:46 +0100 Subject: [PATCH 28/33] Fix some review findings --- examples/Boost-log-shared/CMakeLists.txt | 7 ------- examples/Boost-log/CMakeLists.txt | 7 ------- examples/Boost-math/CMakeLists.txt | 1 + examples/Boost/CMakeLists.txt | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/examples/Boost-log-shared/CMakeLists.txt b/examples/Boost-log-shared/CMakeLists.txt index c6f5e58f6d..de9f397e4d 100644 --- a/examples/Boost-log-shared/CMakeLists.txt +++ b/examples/Boost-log-shared/CMakeLists.txt @@ -11,7 +11,6 @@ set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) #set BUI include("../common.cmake") project(download-boost) -include(CMakePrintHelpers) hunter_add_package(Boost COMPONENTS log) find_package(Boost CONFIG REQUIRED log) @@ -21,9 +20,3 @@ target_link_libraries(foo PUBLIC Boost::log ) - -cmake_print_variables(Boost_VERSION_STRING) -cmake_print_properties( - TARGETS Boost::log - PROPERTIES INTERFACE_LINK_LIBRARIES -) \ No newline at end of file diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index 6d0dac0ad3..82bfb43ee5 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -11,16 +11,9 @@ set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) include("../common.cmake") project(download-boost) -include(CMakePrintHelpers) hunter_add_package(Boost COMPONENTS log) find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::log) - -cmake_print_variables(Boost_VERSION_STRING) -cmake_print_properties( - TARGETS Boost::log - PROPERTIES INTERFACE_LINK_LIBRARIES -) \ No newline at end of file diff --git a/examples/Boost-math/CMakeLists.txt b/examples/Boost-math/CMakeLists.txt index 95a72ae238..15f15e1a02 100644 --- a/examples/Boost-math/CMakeLists.txt +++ b/examples/Boost-math/CMakeLists.txt @@ -14,6 +14,7 @@ project(download-boost) # download boost hunter_add_package(Boost COMPONENTS math) + # now boost::math_* targets # link in all the parts of boost math, or leave out unneeded parts find_package(Boost CONFIG REQUIRED math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index edc674f582..3af1246604 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -16,7 +16,7 @@ hunter_add_package(Boost) find_package(Boost CONFIG REQUIRED) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::boost) # In since boost 1.70 you should use Boost::headers as target +target_link_libraries(foo PUBLIC Boost::boost) # Since boost 1.70 you should use Boost::headers as target set(project_license "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") file( From 14eb85cdca1e7ada86e13f5c87c655440791d317 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Thu, 13 Feb 2020 10:22:21 +0100 Subject: [PATCH 29/33] Increase PACKAGE_INTERNAL_DEPS_ID --- cmake/projects/Boost/atomic/hunter.cmake | 2 +- cmake/projects/Boost/chrono/hunter.cmake | 2 +- cmake/projects/Boost/context/hunter.cmake | 2 +- cmake/projects/Boost/contract/hunter.cmake | 2 +- cmake/projects/Boost/coroutine/hunter.cmake | 2 +- cmake/projects/Boost/date_time/hunter.cmake | 2 +- cmake/projects/Boost/exception/hunter.cmake | 2 +- cmake/projects/Boost/fiber/hunter.cmake | 2 +- cmake/projects/Boost/filesystem/hunter.cmake | 2 +- cmake/projects/Boost/graph/hunter.cmake | 2 +- cmake/projects/Boost/graph_parallel/hunter.cmake | 2 +- cmake/projects/Boost/hunter.cmake | 2 +- cmake/projects/Boost/hunter.cmake.in | 2 +- cmake/projects/Boost/iostreams/hunter.cmake | 2 +- cmake/projects/Boost/locale/hunter.cmake | 2 +- cmake/projects/Boost/log/hunter.cmake | 2 +- cmake/projects/Boost/math/hunter.cmake | 2 +- cmake/projects/Boost/mpi/hunter.cmake | 2 +- cmake/projects/Boost/program_options/hunter.cmake | 2 +- cmake/projects/Boost/python/hunter.cmake | 2 +- cmake/projects/Boost/random/hunter.cmake | 2 +- cmake/projects/Boost/regex/hunter.cmake | 2 +- cmake/projects/Boost/serialization/hunter.cmake | 2 +- cmake/projects/Boost/signals/hunter.cmake | 2 +- cmake/projects/Boost/stacktrace/hunter.cmake | 2 +- cmake/projects/Boost/system/hunter.cmake | 2 +- cmake/projects/Boost/test/hunter.cmake | 2 +- cmake/projects/Boost/thread/hunter.cmake | 2 +- cmake/projects/Boost/timer/hunter.cmake | 2 +- cmake/projects/Boost/wave/hunter.cmake | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cmake/projects/Boost/atomic/hunter.cmake b/cmake/projects/Boost/atomic/hunter.cmake index c8ed6cbaf5..ffe9b97b04 100644 --- a/cmake/projects/Boost/atomic/hunter.cmake +++ b/cmake/projects/Boost/atomic/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT atomic - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/chrono/hunter.cmake b/cmake/projects/Boost/chrono/hunter.cmake index 648270226a..1dfe5444dd 100644 --- a/cmake/projects/Boost/chrono/hunter.cmake +++ b/cmake/projects/Boost/chrono/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT chrono - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/context/hunter.cmake b/cmake/projects/Boost/context/hunter.cmake index 542b4930ef..f3198d656f 100644 --- a/cmake/projects/Boost/context/hunter.cmake +++ b/cmake/projects/Boost/context/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT context - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/contract/hunter.cmake b/cmake/projects/Boost/contract/hunter.cmake index a98fd2ed9b..431ae5926a 100644 --- a/cmake/projects/Boost/contract/hunter.cmake +++ b/cmake/projects/Boost/contract/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT contract - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/coroutine/hunter.cmake b/cmake/projects/Boost/coroutine/hunter.cmake index 618b07aca1..7217543a4d 100644 --- a/cmake/projects/Boost/coroutine/hunter.cmake +++ b/cmake/projects/Boost/coroutine/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT coroutine - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/date_time/hunter.cmake b/cmake/projects/Boost/date_time/hunter.cmake index 267ccd90b4..37b7b76091 100644 --- a/cmake/projects/Boost/date_time/hunter.cmake +++ b/cmake/projects/Boost/date_time/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT date_time - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/exception/hunter.cmake b/cmake/projects/Boost/exception/hunter.cmake index 856f8889b9..df61a6be94 100644 --- a/cmake/projects/Boost/exception/hunter.cmake +++ b/cmake/projects/Boost/exception/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT exception - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/fiber/hunter.cmake b/cmake/projects/Boost/fiber/hunter.cmake index 900b6fdd92..3c63f88c0d 100644 --- a/cmake/projects/Boost/fiber/hunter.cmake +++ b/cmake/projects/Boost/fiber/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT fiber - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/filesystem/hunter.cmake b/cmake/projects/Boost/filesystem/hunter.cmake index 4b1fb3cfa8..3eba982f4c 100644 --- a/cmake/projects/Boost/filesystem/hunter.cmake +++ b/cmake/projects/Boost/filesystem/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT filesystem - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/graph/hunter.cmake b/cmake/projects/Boost/graph/hunter.cmake index 35e827cd82..7afa55e61d 100644 --- a/cmake/projects/Boost/graph/hunter.cmake +++ b/cmake/projects/Boost/graph/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/graph_parallel/hunter.cmake b/cmake/projects/Boost/graph_parallel/hunter.cmake index f4461f9153..d42a72e6b4 100644 --- a/cmake/projects/Boost/graph_parallel/hunter.cmake +++ b/cmake/projects/Boost/graph_parallel/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph_parallel - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index e96afb6ff6..dce69a67fd 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -422,7 +422,7 @@ endif() hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) -hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "46") +hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "48") if(NOT HUNTER_Boost_VERSION VERSION_LESS 1.72.0) diff --git a/cmake/projects/Boost/hunter.cmake.in b/cmake/projects/Boost/hunter.cmake.in index 588ff7093d..602e6a1142 100644 --- a/cmake/projects/Boost/hunter.cmake.in +++ b/cmake/projects/Boost/hunter.cmake.in @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT boost_component - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/iostreams/hunter.cmake b/cmake/projects/Boost/iostreams/hunter.cmake index 3bd5053d27..5fb3eb8cb1 100644 --- a/cmake/projects/Boost/iostreams/hunter.cmake +++ b/cmake/projects/Boost/iostreams/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT iostreams - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/locale/hunter.cmake b/cmake/projects/Boost/locale/hunter.cmake index 6b6cc7dc63..7a98c3e927 100644 --- a/cmake/projects/Boost/locale/hunter.cmake +++ b/cmake/projects/Boost/locale/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT locale - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/log/hunter.cmake b/cmake/projects/Boost/log/hunter.cmake index e0e95e4fbc..d5916f092b 100644 --- a/cmake/projects/Boost/log/hunter.cmake +++ b/cmake/projects/Boost/log/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT log - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/math/hunter.cmake b/cmake/projects/Boost/math/hunter.cmake index 5b63816155..bb703e1993 100644 --- a/cmake/projects/Boost/math/hunter.cmake +++ b/cmake/projects/Boost/math/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT math - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/mpi/hunter.cmake b/cmake/projects/Boost/mpi/hunter.cmake index 52e84041f6..023a7999b5 100644 --- a/cmake/projects/Boost/mpi/hunter.cmake +++ b/cmake/projects/Boost/mpi/hunter.cmake @@ -26,5 +26,5 @@ hunter_download( Boost PACKAGE_COMPONENT mpi - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/program_options/hunter.cmake b/cmake/projects/Boost/program_options/hunter.cmake index 58567e6dd6..625c00affc 100644 --- a/cmake/projects/Boost/program_options/hunter.cmake +++ b/cmake/projects/Boost/program_options/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT program_options - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/python/hunter.cmake b/cmake/projects/Boost/python/hunter.cmake index aa085d0cdf..76448ce7c3 100644 --- a/cmake/projects/Boost/python/hunter.cmake +++ b/cmake/projects/Boost/python/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT python - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/random/hunter.cmake b/cmake/projects/Boost/random/hunter.cmake index c6e7d6d9fe..a8773af2c2 100644 --- a/cmake/projects/Boost/random/hunter.cmake +++ b/cmake/projects/Boost/random/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT random - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/regex/hunter.cmake b/cmake/projects/Boost/regex/hunter.cmake index b8c905ba9d..22cff29e3f 100644 --- a/cmake/projects/Boost/regex/hunter.cmake +++ b/cmake/projects/Boost/regex/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT regex - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/serialization/hunter.cmake b/cmake/projects/Boost/serialization/hunter.cmake index 0a8a556748..b87adad2fc 100644 --- a/cmake/projects/Boost/serialization/hunter.cmake +++ b/cmake/projects/Boost/serialization/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT serialization - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/signals/hunter.cmake b/cmake/projects/Boost/signals/hunter.cmake index db3c17c45b..21a98f910c 100644 --- a/cmake/projects/Boost/signals/hunter.cmake +++ b/cmake/projects/Boost/signals/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT signals - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/stacktrace/hunter.cmake b/cmake/projects/Boost/stacktrace/hunter.cmake index f4850a5032..29252182a4 100644 --- a/cmake/projects/Boost/stacktrace/hunter.cmake +++ b/cmake/projects/Boost/stacktrace/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT stacktrace - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/system/hunter.cmake b/cmake/projects/Boost/system/hunter.cmake index dc7e7c43c6..f4a5ddace0 100644 --- a/cmake/projects/Boost/system/hunter.cmake +++ b/cmake/projects/Boost/system/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT system - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/test/hunter.cmake b/cmake/projects/Boost/test/hunter.cmake index 532c5a185c..6614f40d61 100644 --- a/cmake/projects/Boost/test/hunter.cmake +++ b/cmake/projects/Boost/test/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT test - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/thread/hunter.cmake b/cmake/projects/Boost/thread/hunter.cmake index 906485f3ee..a57239b86f 100644 --- a/cmake/projects/Boost/thread/hunter.cmake +++ b/cmake/projects/Boost/thread/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT thread - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/timer/hunter.cmake b/cmake/projects/Boost/timer/hunter.cmake index fb1b662300..4807b1304f 100644 --- a/cmake/projects/Boost/timer/hunter.cmake +++ b/cmake/projects/Boost/timer/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT timer - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) diff --git a/cmake/projects/Boost/wave/hunter.cmake b/cmake/projects/Boost/wave/hunter.cmake index e64fb469e5..50fd90894e 100644 --- a/cmake/projects/Boost/wave/hunter.cmake +++ b/cmake/projects/Boost/wave/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT wave - PACKAGE_INTERNAL_DEPS_ID "46" + PACKAGE_INTERNAL_DEPS_ID "48" ) From 1f1e7295e026b5b6bdf6122a98d36d521fff1dbb Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Sun, 16 Feb 2020 15:00:36 +0100 Subject: [PATCH 30/33] Create boost config from boost if USE_CONFIG_FROM_BOOST is set --- cmake/projects/Boost/schemes/url_sha1_boost.cmake.in | 2 +- .../projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in | 2 +- cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index e09e9ffbba..9d9cab6e4d 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -105,7 +105,7 @@ configure_file( set(pass_boost_no_cmake_config ) -if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0) +if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0 AND NOT USE_CONFIG_FROM_BOOST) set(pass_boost_no_cmake_config --no-cmake-config) endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index 85d9dad2d7..a7fce1a634 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -133,7 +133,7 @@ set( --user-config="${boost_user_jam}" ) -if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0) +if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0 AND NOT USE_CONFIG_FROM_BOOST) list(APPEND build_opts --no-cmake-config ) endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 06863a5d23..a950038bd3 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -233,7 +233,7 @@ set( --with-@HUNTER_PACKAGE_COMPONENT@ ) -if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0) +if (@HUNTER_Boost_VERSION@ VERSION_GREATER_EQUAL 1.72.0 AND NOT USE_CONFIG_FROM_BOOST) list(APPEND build_opts --no-cmake-config ) endif() From b2bd8aec97e9ef3c6aa1808ebd2ec5188eb1cdaa Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Mon, 24 Feb 2020 06:56:29 +0100 Subject: [PATCH 31/33] Use only some examples to use config from boost --- .../CMakeLists.txt | 23 +++++++ .../config.cmake | 0 examples/Boost-chrono-useBoostConfig/foo.cpp | 6 ++ examples/Boost-chrono/CMakeLists.txt | 8 ++- examples/Boost-contract/CMakeLists.txt | 3 +- examples/Boost-fiber/CMakeLists.txt | 7 +- .../CMakeLists.txt | 66 +++++++++++++++++++ .../config.cmake | 0 .../Boost-filesystem-useBoostConfig/foo.cpp | 7 ++ .../foo_android.cpp | 21 ++++++ examples/Boost-filesystem/CMakeLists.txt | 8 ++- .../CMakeLists.txt | 23 +++++++ .../config.cmake | 0 .../Boost-iostreams-useBoostConfig/foo.cpp | 66 +++++++++++++++++++ examples/Boost-iostreams/CMakeLists.txt | 7 +- examples/Boost-log-shared/CMakeLists.txt | 12 +++- examples/Boost-log-shared/config.cmake | 4 -- .../Boost-log-useBoostConfig/CMakeLists.txt | 19 ++++++ .../config.cmake | 0 examples/Boost-log-useBoostConfig/foo.cpp | 12 ++++ examples/Boost-log/CMakeLists.txt | 12 +++- examples/Boost-log/config.cmake | 4 -- examples/Boost-math/CMakeLists.txt | 1 - examples/Boost-math/config.cmake | 4 -- examples/Boost-program-options/CMakeLists.txt | 1 - examples/Boost-program-options/config.cmake | 4 -- examples/Boost-python-numpy/config.cmake | 2 +- examples/Boost-python/config.cmake | 2 +- examples/Boost-random/CMakeLists.txt | 1 - examples/Boost-random/config.cmake | 4 -- examples/Boost-serialization/CMakeLists.txt | 1 - examples/Boost-serialization/config.cmake | 4 -- examples/Boost-stacktrace/CMakeLists.txt | 1 - examples/Boost-stacktrace/config.cmake | 4 -- examples/Boost-system/CMakeLists.txt | 1 - examples/Boost-system/config.cmake | 4 -- examples/Boost-test/CMakeLists.txt | 1 - examples/Boost-test/config.cmake | 4 -- examples/Boost-thread/CMakeLists.txt | 7 +- examples/Boost-thread/config.cmake | 4 -- examples/Boost-useBoostConfig/CMakeLists.txt | 48 ++++++++++++++ .../config.cmake | 0 examples/Boost-useBoostConfig/foo.cpp | 4 ++ examples/Boost-uuid/CMakeLists.txt | 1 - examples/Boost-uuid/config.cmake | 4 -- examples/Boost/CMakeLists.txt | 1 - examples/Boost/config.cmake | 4 -- 47 files changed, 335 insertions(+), 85 deletions(-) create mode 100644 examples/Boost-chrono-useBoostConfig/CMakeLists.txt rename examples/{Boost-chrono => Boost-chrono-useBoostConfig}/config.cmake (100%) create mode 100644 examples/Boost-chrono-useBoostConfig/foo.cpp create mode 100644 examples/Boost-filesystem-useBoostConfig/CMakeLists.txt rename examples/{Boost-contract => Boost-filesystem-useBoostConfig}/config.cmake (100%) create mode 100644 examples/Boost-filesystem-useBoostConfig/foo.cpp create mode 100644 examples/Boost-filesystem-useBoostConfig/foo_android.cpp create mode 100644 examples/Boost-iostreams-useBoostConfig/CMakeLists.txt rename examples/{Boost-fiber => Boost-iostreams-useBoostConfig}/config.cmake (100%) create mode 100644 examples/Boost-iostreams-useBoostConfig/foo.cpp delete mode 100644 examples/Boost-log-shared/config.cmake create mode 100644 examples/Boost-log-useBoostConfig/CMakeLists.txt rename examples/{Boost-filesystem => Boost-log-useBoostConfig}/config.cmake (100%) create mode 100644 examples/Boost-log-useBoostConfig/foo.cpp delete mode 100644 examples/Boost-log/config.cmake delete mode 100644 examples/Boost-math/config.cmake delete mode 100644 examples/Boost-program-options/config.cmake delete mode 100644 examples/Boost-random/config.cmake delete mode 100644 examples/Boost-serialization/config.cmake delete mode 100644 examples/Boost-stacktrace/config.cmake delete mode 100644 examples/Boost-system/config.cmake delete mode 100644 examples/Boost-test/config.cmake delete mode 100644 examples/Boost-thread/config.cmake create mode 100644 examples/Boost-useBoostConfig/CMakeLists.txt rename examples/{Boost-iostreams => Boost-useBoostConfig}/config.cmake (100%) create mode 100644 examples/Boost-useBoostConfig/foo.cpp delete mode 100644 examples/Boost-uuid/config.cmake delete mode 100644 examples/Boost/config.cmake diff --git a/examples/Boost-chrono-useBoostConfig/CMakeLists.txt b/examples/Boost-chrono-useBoostConfig/CMakeLists.txt new file mode 100644 index 0000000000..6ba8ec001b --- /dev/null +++ b/examples/Boost-chrono-useBoostConfig/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +hunter_add_package(Boost COMPONENTS chrono) +find_package(Boost CONFIG REQUIRED chrono) + +add_executable(foo foo.cpp) +target_link_libraries( + foo + PUBLIC + Boost::chrono +) diff --git a/examples/Boost-chrono/config.cmake b/examples/Boost-chrono-useBoostConfig/config.cmake similarity index 100% rename from examples/Boost-chrono/config.cmake rename to examples/Boost-chrono-useBoostConfig/config.cmake diff --git a/examples/Boost-chrono-useBoostConfig/foo.cpp b/examples/Boost-chrono-useBoostConfig/foo.cpp new file mode 100644 index 0000000000..33c0516210 --- /dev/null +++ b/examples/Boost-chrono-useBoostConfig/foo.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + boost::chrono::system_clock::now(); + return 0; +} diff --git a/examples/Boost-chrono/CMakeLists.txt b/examples/Boost-chrono/CMakeLists.txt index 6ba8ec001b..8152a6e319 100644 --- a/examples/Boost-chrono/CMakeLists.txt +++ b/examples/Boost-chrono/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -12,12 +11,15 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS chrono) -find_package(Boost CONFIG REQUIRED chrono) +hunter_add_package(Boost COMPONENTS system chrono) +find_package(Boost CONFIG REQUIRED system chrono) add_executable(foo foo.cpp) target_link_libraries( foo PUBLIC Boost::chrono + Boost::system # Should be last + # Boost 1.66.0, Linux, Clang with -stdlib=libstdc++: + # * https://travis-ci.org/ingenue/hunter/jobs/318140468#L2651 ) diff --git a/examples/Boost-contract/CMakeLists.txt b/examples/Boost-contract/CMakeLists.txt index 7c7acc0c03..c70258414d 100644 --- a/examples/Boost-contract/CMakeLists.txt +++ b/examples/Boost-contract/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -16,4 +15,4 @@ hunter_add_package(Boost COMPONENTS system contract) find_package(Boost CONFIG REQUIRED system contract) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::contract) +target_link_libraries(foo PUBLIC Boost::system Boost::contract) diff --git a/examples/Boost-fiber/CMakeLists.txt b/examples/Boost-fiber/CMakeLists.txt index 765aad205e..401f7332d8 100644 --- a/examples/Boost-fiber/CMakeLists.txt +++ b/examples/Boost-fiber/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -12,8 +11,8 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS fiber) -find_package(Boost CONFIG REQUIRED fiber) +hunter_add_package(Boost COMPONENTS context fiber) +find_package(Boost CONFIG REQUIRED context fiber) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::fiber) +target_link_libraries(foo PUBLIC Boost::context Boost::fiber) diff --git a/examples/Boost-filesystem-useBoostConfig/CMakeLists.txt b/examples/Boost-filesystem-useBoostConfig/CMakeLists.txt new file mode 100644 index 0000000000..9bb5b74ced --- /dev/null +++ b/examples/Boost-filesystem-useBoostConfig/CMakeLists.txt @@ -0,0 +1,66 @@ +# Copyright (c) 2013-2015, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +# download boost +hunter_add_package(Boost COMPONENTS filesystem) + +# now boost can be used +find_package(Boost CONFIG REQUIRED filesystem) + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_ANDROID_NDK}" "" is_empty) + if(is_empty) + message(FATAL_ERROR "CMAKE_ANDROID_NDK is empty") + endif() + add_library( + foo + SHARED + foo_android.cpp + "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c" + ) +else() + add_executable(foo foo.cpp) +endif() + +target_link_libraries( + foo + Boost::filesystem +) + +if(ANDROID) + target_link_libraries(foo log android) + target_include_directories( + foo PUBLIC "${CMAKE_ANDROID_NDK}/sources/android/native_app_glue" + ) + + if(NOT "$ENV{TRAVIS}") + # Travis CI failed builds: + # * https://travis-ci.org/ingenue/hunter/jobs/106905844 + # * https://travis-ci.org/ingenue/hunter/jobs/106905851 + hunter_add_package(Android-Apk) + list(APPEND CMAKE_MODULE_PATH "${ANDROID-APK_ROOT}") + include(AndroidApk) + + hunter_add_package(Android-SDK) + message("Path to `android`: ${ANDROID-SDK_ROOT}/android-sdk/tools/android") + message("Path to `emulator`: ${ANDROID-SDK_ROOT}/android-sdk/tools/emulator") + message("Path to `adb`: ${ANDROID-SDK_ROOT}/android-sdk/platform-tools/adb") + + android_create_apk( + BASE_TARGET foo + LAUNCH_TARGET foo-launch + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/apk" + ) + endif() +endif() diff --git a/examples/Boost-contract/config.cmake b/examples/Boost-filesystem-useBoostConfig/config.cmake similarity index 100% rename from examples/Boost-contract/config.cmake rename to examples/Boost-filesystem-useBoostConfig/config.cmake diff --git a/examples/Boost-filesystem-useBoostConfig/foo.cpp b/examples/Boost-filesystem-useBoostConfig/foo.cpp new file mode 100644 index 0000000000..13f5f90676 --- /dev/null +++ b/examples/Boost-filesystem-useBoostConfig/foo.cpp @@ -0,0 +1,7 @@ +#include +#include // std::cout + +int main() { + namespace fs = boost::filesystem; + std::cout << "Current path: " << fs::current_path() << std::endl; +} diff --git a/examples/Boost-filesystem-useBoostConfig/foo_android.cpp b/examples/Boost-filesystem-useBoostConfig/foo_android.cpp new file mode 100644 index 0000000000..b86604683d --- /dev/null +++ b/examples/Boost-filesystem-useBoostConfig/foo_android.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2015, Ruslan Baratov +// All rights reserved. + +#include + +#include +#include + +void android_main(struct android_app* state) { + app_dummy(); // Make sure glue isn't stripped + + namespace fs = boost::filesystem; + + __android_log_print( + ANDROID_LOG_INFO, + "BoostFilesystemExample", + fs::current_path().c_str() + ); + + ANativeActivity_finish(state->activity); +} diff --git a/examples/Boost-filesystem/CMakeLists.txt b/examples/Boost-filesystem/CMakeLists.txt index 9bb5b74ced..1ae09d42a0 100644 --- a/examples/Boost-filesystem/CMakeLists.txt +++ b/examples/Boost-filesystem/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -13,10 +12,10 @@ include("../common.cmake") project(download-boost) # download boost -hunter_add_package(Boost COMPONENTS filesystem) +hunter_add_package(Boost COMPONENTS system filesystem) # now boost can be used -find_package(Boost CONFIG REQUIRED filesystem) +find_package(Boost CONFIG REQUIRED system filesystem) if(ANDROID) string(COMPARE EQUAL "${CMAKE_ANDROID_NDK}" "" is_empty) @@ -36,6 +35,9 @@ endif() target_link_libraries( foo Boost::filesystem + Boost::system # Should be last + # Boost 1.66.0, Linux, Clang with -stdlib=libstdc++: + # * https://travis-ci.org/ingenue/hunter/jobs/318140416#L2674 ) if(ANDROID) diff --git a/examples/Boost-iostreams-useBoostConfig/CMakeLists.txt b/examples/Boost-iostreams-useBoostConfig/CMakeLists.txt new file mode 100644 index 0000000000..f817e0c1ee --- /dev/null +++ b/examples/Boost-iostreams-useBoostConfig/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2015, Aaditya Kalsi +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(boost_iostreams) + +hunter_add_package(Boost COMPONENTS iostreams serialization) +# If you use boost/iostreams/filter/gzip.hpp then you should add ZLIB +find_package(ZLIB CONFIG REQUIRED) +# If you use boost/iostreams/filter/bzip2.hpp then you should add BZip2 +find_package(BZip2 CONFIG REQUIRED) +find_package(Boost CONFIG REQUIRED iostreams serialization) + +add_executable(foo foo.cpp) +target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization ZLIB::zlib BZip2::bz2) diff --git a/examples/Boost-fiber/config.cmake b/examples/Boost-iostreams-useBoostConfig/config.cmake similarity index 100% rename from examples/Boost-fiber/config.cmake rename to examples/Boost-iostreams-useBoostConfig/config.cmake diff --git a/examples/Boost-iostreams-useBoostConfig/foo.cpp b/examples/Boost-iostreams-useBoostConfig/foo.cpp new file mode 100644 index 0000000000..f49eb2a8fb --- /dev/null +++ b/examples/Boost-iostreams-useBoostConfig/foo.cpp @@ -0,0 +1,66 @@ +// Copyright (c) 2015, David Hirvonen +// All rights reserved. + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +struct Record +{ + Record() {} + Record(int age, const std::string &name) : age(age), name(name) {} + + int age; + std::string name; + + // Boost serialization: + //friend class boost::serialization::access; + template void serialize(Archive & ar, const unsigned int version) + { + ar & age; + ar & name; + } +}; + +int main(int argc, char **argv) +{ + std::string filename = "/tmp/record.dat"; + + typedef boost::iostreams::zlib_compressor Compressor; + typedef boost::iostreams::zlib_decompressor Decompressor; + + { // Dump the record: + Record record(1, "kermit"); + std::ofstream ofs(filename, std::ios_base::out | std::ios_base::binary); + if(ofs) + { + boost::iostreams::filtering_stream buffer; + buffer.push(Compressor()); + buffer.push(ofs); + boost::archive::binary_oarchive oa(buffer); + oa << record; + } + } + + { // Load the record + Record record; + std::ifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + if(ifs) + { + boost::iostreams::filtering_streambuf buffer; + buffer.push(Decompressor()); + buffer.push(ifs); + boost::archive::binary_iarchive ia(buffer); // (ifs); + ia >> record; + } + } +} + diff --git a/examples/Boost-iostreams/CMakeLists.txt b/examples/Boost-iostreams/CMakeLists.txt index f817e0c1ee..8edd8b2399 100644 --- a/examples/Boost-iostreams/CMakeLists.txt +++ b/examples/Boost-iostreams/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -13,11 +12,7 @@ include("../common.cmake") project(boost_iostreams) hunter_add_package(Boost COMPONENTS iostreams serialization) -# If you use boost/iostreams/filter/gzip.hpp then you should add ZLIB -find_package(ZLIB CONFIG REQUIRED) -# If you use boost/iostreams/filter/bzip2.hpp then you should add BZip2 -find_package(BZip2 CONFIG REQUIRED) find_package(Boost CONFIG REQUIRED iostreams serialization) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization ZLIB::zlib BZip2::bz2) +target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization) diff --git a/examples/Boost-log-shared/CMakeLists.txt b/examples/Boost-log-shared/CMakeLists.txt index de9f397e4d..82b3df15b1 100644 --- a/examples/Boost-log-shared/CMakeLists.txt +++ b/examples/Boost-log-shared/CMakeLists.txt @@ -12,11 +12,19 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS log) -find_package(Boost CONFIG REQUIRED log) +hunter_add_package(Boost COMPONENTS log filesystem system chrono thread regex date_time atomic) +find_package(Boost CONFIG REQUIRED log filesystem system chrono thread regex date_time atomic) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::log + Boost::filesystem + Boost::system + Boost::chrono + Boost::thread + Boost::regex + Boost::date_time + Boost::atomic + Boost::boost ) diff --git a/examples/Boost-log-shared/config.cmake b/examples/Boost-log-shared/config.cmake deleted file mode 100644 index f9ab533253..0000000000 --- a/examples/Boost-log-shared/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS BUILD_SHARED_LIBS=ON USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-log-useBoostConfig/CMakeLists.txt b/examples/Boost-log-useBoostConfig/CMakeLists.txt new file mode 100644 index 0000000000..82bfb43ee5 --- /dev/null +++ b/examples/Boost-log-useBoostConfig/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +hunter_add_package(Boost COMPONENTS log) +find_package(Boost CONFIG REQUIRED log) + +add_executable(foo foo.cpp) +target_link_libraries(foo PUBLIC Boost::log) diff --git a/examples/Boost-filesystem/config.cmake b/examples/Boost-log-useBoostConfig/config.cmake similarity index 100% rename from examples/Boost-filesystem/config.cmake rename to examples/Boost-log-useBoostConfig/config.cmake diff --git a/examples/Boost-log-useBoostConfig/foo.cpp b/examples/Boost-log-useBoostConfig/foo.cpp new file mode 100644 index 0000000000..1f56b3f693 --- /dev/null +++ b/examples/Boost-log-useBoostConfig/foo.cpp @@ -0,0 +1,12 @@ +#include + +int main() { + BOOST_LOG_TRIVIAL(trace) << "A trace severity message"; + BOOST_LOG_TRIVIAL(debug) << "A debug severity message"; + BOOST_LOG_TRIVIAL(info) << "An informational severity message"; + BOOST_LOG_TRIVIAL(warning) << "A warning severity message"; + BOOST_LOG_TRIVIAL(error) << "An error severity message"; + BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message"; + + return 0; +} diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index 82bfb43ee5..0bc1521a6c 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -16,4 +15,13 @@ hunter_add_package(Boost COMPONENTS log) find_package(Boost CONFIG REQUIRED log) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::log) +target_link_libraries(foo PUBLIC Boost::log + Boost::filesystem + Boost::chrono + Boost::thread + Boost::regex + Boost::date_time + Boost::atomic + Boost::system + Boost::boost +) diff --git a/examples/Boost-log/config.cmake b/examples/Boost-log/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-log/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-math/CMakeLists.txt b/examples/Boost-math/CMakeLists.txt index 15f15e1a02..fd4340f8e6 100644 --- a/examples/Boost-math/CMakeLists.txt +++ b/examples/Boost-math/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-math/config.cmake b/examples/Boost-math/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-math/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-program-options/CMakeLists.txt b/examples/Boost-program-options/CMakeLists.txt index bd1453e390..c8375c594e 100644 --- a/examples/Boost-program-options/CMakeLists.txt +++ b/examples/Boost-program-options/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-program-options/config.cmake b/examples/Boost-program-options/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-program-options/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-python-numpy/config.cmake b/examples/Boost-python-numpy/config.cmake index 9fbef33c61..dbc2733f06 100644 --- a/examples/Boost-python-numpy/config.cmake +++ b/examples/Boost-python-numpy/config.cmake @@ -1,4 +1,4 @@ # Note: PYTHON_VERSION is optional. Refer to Boost package documentation on how # and when to use it: https://cpp-pm-hunter.readthedocs.io/en/latest/packages/pkg/Boost.html#cmake-options -hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} HUNTER_ENABLE_BOOST_PYTHON_NUMPY=True USE_CONFIG_FROM_BOOST=ON) +hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} HUNTER_ENABLE_BOOST_PYTHON_NUMPY=True) hunter_config(hunter_venv VERSION ${HUNTER_hunter_venv_VERSION} CMAKE_ARGS HUNTER_VENV_PYTHON_VERSION=${PYTHON_VERSION}) diff --git a/examples/Boost-python/config.cmake b/examples/Boost-python/config.cmake index d02dee4459..fa638c3ec9 100644 --- a/examples/Boost-python/config.cmake +++ b/examples/Boost-python/config.cmake @@ -1,3 +1,3 @@ # Note: PYTHON_VERSION is optional. Refer to Boost package documentation on how # and when to use it: https://hunter.readthedocs.io/en/latest/packages/pkg/Boost.html#cmake-options -hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION} USE_CONFIG_FROM_BOOST=ON) +hunter_config(Boost VERSION ${HUNTER_Boost_VERSION} CMAKE_ARGS PYTHON_VERSION=${PYTHON_VERSION}) diff --git a/examples/Boost-random/CMakeLists.txt b/examples/Boost-random/CMakeLists.txt index 485c608aac..70b56b530a 100644 --- a/examples/Boost-random/CMakeLists.txt +++ b/examples/Boost-random/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-random/config.cmake b/examples/Boost-random/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-random/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-serialization/CMakeLists.txt b/examples/Boost-serialization/CMakeLists.txt index c691919149..e73204d557 100644 --- a/examples/Boost-serialization/CMakeLists.txt +++ b/examples/Boost-serialization/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-serialization/config.cmake b/examples/Boost-serialization/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-serialization/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-stacktrace/CMakeLists.txt b/examples/Boost-stacktrace/CMakeLists.txt index 37aab3759b..0bcace8efe 100644 --- a/examples/Boost-stacktrace/CMakeLists.txt +++ b/examples/Boost-stacktrace/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.2) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-stacktrace/config.cmake b/examples/Boost-stacktrace/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-stacktrace/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-system/CMakeLists.txt b/examples/Boost-system/CMakeLists.txt index 1256892eb5..2e125023bf 100644 --- a/examples/Boost-system/CMakeLists.txt +++ b/examples/Boost-system/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-system/config.cmake b/examples/Boost-system/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-system/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-test/CMakeLists.txt b/examples/Boost-test/CMakeLists.txt index a342f07083..3fa14ce10d 100644 --- a/examples/Boost-test/CMakeLists.txt +++ b/examples/Boost-test/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-test/config.cmake b/examples/Boost-test/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-test/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-thread/CMakeLists.txt b/examples/Boost-thread/CMakeLists.txt index 5dd678befe..0595070c47 100644 --- a/examples/Boost-thread/CMakeLists.txt +++ b/examples/Boost-thread/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate @@ -12,8 +11,8 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS thread) -find_package(Boost CONFIG REQUIRED thread) +hunter_add_package(Boost COMPONENTS system thread) +find_package(Boost CONFIG REQUIRED system thread) add_executable(foo foo.cpp) -target_link_libraries(foo PUBLIC Boost::thread) +target_link_libraries(foo PUBLIC Boost::system Boost::thread) diff --git a/examples/Boost-thread/config.cmake b/examples/Boost-thread/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-thread/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost-useBoostConfig/CMakeLists.txt b/examples/Boost-useBoostConfig/CMakeLists.txt new file mode 100644 index 0000000000..b261ad51d3 --- /dev/null +++ b/examples/Boost-useBoostConfig/CMakeLists.txt @@ -0,0 +1,48 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +set(Boost_DEBUG ON CACHE BOOLEAN "") +set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-boost) + +hunter_add_package(Boost) +find_package(Boost CONFIG REQUIRED) + +add_executable(foo foo.cpp) +target_link_libraries(foo PUBLIC Boost::headers) # Since boost 1.70 you should use Boost::headers as target + +set(project_license "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") +file( + WRITE + "${project_license}" + "Some info about this project license.\n\n" +) + +string(COMPARE EQUAL "${Boost_LICENSES}" "" is_empty) +if(is_empty) + message(FATAL_ERROR "No licenses") +endif() + +file(APPEND "${project_license}" "== 3rd party licenses ==\n\n") + +foreach(x ${Boost_LICENSES}) + file(READ "${x}" content) + get_filename_component(license_name "${x}" NAME) + file(APPEND "${project_license}" "== Boost (${license_name}) ==\n\n") + file(APPEND "${project_license}" "${content}") +endforeach() + +message("Project license: ${project_license}") + +file(GLOB_RECURSE boost_configs "${BOOST_ROOT}/*/BoostConfig.cmake") +list(LENGTH boost_configs len) +if(NOT len EQUAL "1") + message(FATAL_ERROR "More than one *Config: ${boost_configs}") +endif() diff --git a/examples/Boost-iostreams/config.cmake b/examples/Boost-useBoostConfig/config.cmake similarity index 100% rename from examples/Boost-iostreams/config.cmake rename to examples/Boost-useBoostConfig/config.cmake diff --git a/examples/Boost-useBoostConfig/foo.cpp b/examples/Boost-useBoostConfig/foo.cpp new file mode 100644 index 0000000000..28f9a77ef2 --- /dev/null +++ b/examples/Boost-useBoostConfig/foo.cpp @@ -0,0 +1,4 @@ +#include + +int main() { +} diff --git a/examples/Boost-uuid/CMakeLists.txt b/examples/Boost-uuid/CMakeLists.txt index 0e20b6cffc..fb131a17dc 100644 --- a/examples/Boost-uuid/CMakeLists.txt +++ b/examples/Boost-uuid/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost-uuid/config.cmake b/examples/Boost-uuid/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost-uuid/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) diff --git a/examples/Boost/CMakeLists.txt b/examples/Boost/CMakeLists.txt index 3af1246604..4b30e30889 100644 --- a/examples/Boost/CMakeLists.txt +++ b/examples/Boost/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0) set(Boost_DEBUG ON CACHE BOOLEAN "") -set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake) # Emulate HunterGate: # * https://github.com/hunter-packages/gate diff --git a/examples/Boost/config.cmake b/examples/Boost/config.cmake deleted file mode 100644 index 9daa4a1d95..0000000000 --- a/examples/Boost/config.cmake +++ /dev/null @@ -1,4 +0,0 @@ -hunter_config(Boost - VERSION ${HUNTER_Boost_VERSION} - CMAKE_ARGS USE_CONFIG_FROM_BOOST=ON -) From 8ff9b7152d16c06672ff520b69a0517190f73e56 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 25 Feb 2020 05:54:19 +0100 Subject: [PATCH 32/33] Fix boost log example --- examples/Boost-log-shared/config.cmake | 4 ++++ examples/Boost-log/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 examples/Boost-log-shared/config.cmake diff --git a/examples/Boost-log-shared/config.cmake b/examples/Boost-log-shared/config.cmake new file mode 100644 index 0000000000..0bf7053a2f --- /dev/null +++ b/examples/Boost-log-shared/config.cmake @@ -0,0 +1,4 @@ +hunter_config(Boost + VERSION ${HUNTER_Boost_VERSION} + CMAKE_ARGS BUILD_SHARED_LIBS=ON +) diff --git a/examples/Boost-log/CMakeLists.txt b/examples/Boost-log/CMakeLists.txt index 0bc1521a6c..49874c456f 100644 --- a/examples/Boost-log/CMakeLists.txt +++ b/examples/Boost-log/CMakeLists.txt @@ -11,8 +11,8 @@ include("../common.cmake") project(download-boost) -hunter_add_package(Boost COMPONENTS log) -find_package(Boost CONFIG REQUIRED log) +hunter_add_package(Boost COMPONENTS log filesystem system chrono thread regex date_time atomic) +find_package(Boost CONFIG REQUIRED log filesystem system chrono thread regex date_time atomic) add_executable(foo foo.cpp) target_link_libraries(foo PUBLIC Boost::log From 4187249b2a5e5ba233bcb9eb11e8b93356ae628f Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 4 Mar 2020 20:54:01 +0100 Subject: [PATCH 33/33] Add USE_CONFIG_FROM_BOOST hint in boost doc --- docs/packages/pkg/Boost.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/packages/pkg/Boost.rst b/docs/packages/pkg/Boost.rst index f4477bd5bb..b1c637acd6 100644 --- a/docs/packages/pkg/Boost.rst +++ b/docs/packages/pkg/Boost.rst @@ -88,6 +88,15 @@ config file (``boost/config/user.hpp``): #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #define BOOST_MPL_LIMIT_LIST_SIZE 3 + - Option ``USE_CONFIG_FROM_BOOST=ON`` use the package configuration file provided + by the boost project. + Since boost version 1.70.0, the boost project provide a well maintained package + configuration file for use with find_package's config mode. + See the difference between following example: + - `Boost-log `__ + - `Boost-log-usingBoostConfig `__ + + Python ------