Boost¶
# Header-only libraries
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)
target_link_libraries(... Boost::boost)
# Boost components (see list below)
hunter_add_package(Boost COMPONENTS system filesystem)
find_package(Boost CONFIG REQUIRED system filesystem)
target_link_libraries(... Boost::system Boost::filesystem)
Examples:
List of components (other libraries are header-only):
atomicchronocontextcoroutinedate_timeexceptionfilesystemgraphgraph_paralleliostreamslocalelogmathmpiprogram_optionspythonrandomregexserializationsignalssystemtestthreadtimerwave
Compatibility mode¶
hunter_add_package(Boost COMPONENTS system filesystem)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED system filesystem)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB=1)
endif()
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(... ${Boost_LIBRARIES})
CMake options¶
CMake options can be passed to boost build using CMAKE_ARGS feature
(see
customization).
Options of special form <COMPONENT-UPPERCASE>_<OPTION>=<VALUE> will
be added to b2 as -s <OPTION>=<VALUE> while building component .
For example:
hunter_config(Boost VERSION ... CMAKE_ARGS IOSTREAMS_NO_BZIP2=1)
# add NO_BZIP2=1 to the b2 build of iostreams library, i.e. `b2 -s NO_BZIP2=1`
Bugs¶
- Only static libs supported for now
- boost.system analyzer
- boost.filesystem analyzer
- boost mingw
- arm64 unknown
- workaround: set additional
armv7, i.e. whenarm64build alone - result will be universal libraryarmv7+arm64
- workaround: set additional
CI¶
- Testing branch: https://github.com/ingenue/hunter/tree/pkg.boost