Skip to content

Instantly share code, notes, and snippets.

@freol35241
Last active August 14, 2025 07:56
Show Gist options
  • Save freol35241/046ea1c018f4a59db456bc64bbc6aebd to your computer and use it in GitHub Desktop.
Save freol35241/046ea1c018f4a59db456bc64bbc6aebd to your computer and use it in GitHub Desktop.
CPM.cmake + Boost (header libs only)
CPMAddPackage(
NAME Boost
VERSION 1.76.0
URL https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.gz
DOWNLOAD_ONLY True
)
if(Boost_ADDED)
# Define the header-only Boost target
add_library(Boost::boost INTERFACE IMPORTED GLOBAL)
target_include_directories(Boost::boost SYSTEM INTERFACE ${Boost_SOURCE_DIR})
# Disable autolink
target_compile_definitions(Boost::boost INTERFACE BOOST_ALL_NO_LIB=1)
endif()
# target_link_libraries(your_project Boost::boost)
@freol35241
Copy link
Author

Updating with url of new hosting service of boost releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment