Last active
October 25, 2024 22:10
-
-
Save freol35241/046ea1c018f4a59db456bc64bbc6aebd to your computer and use it in GitHub Desktop.
CPM.cmake + Boost (header libs only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPMAddPackage( | |
NAME Boost | |
VERSION 1.76.0 | |
URL https://boostorg.jfrog.io/artifactory/main/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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment