Closed hungptit closed 1 year ago
I can use some boost libraries successfully using this pattern.
set(BOOST_INCLUDE_LIBRARIES json) set(BOOST_ENABLE_CMAKE ON) include(FetchContent) FetchContent_Declare( Boost GIT_REPOSITORY https://github.com/boostorg/boost.git GIT_TAG boost-1.83.0 GIT_SHALLOW TRUE ) FetchContent_MakeAvailable(Boost) # Compile some code against boost::json set(LIBNAME "smoketests_utilities") add_library( ${LIBNAME} STATIC address.cpp client.cpp server.cpp) target_link_libraries(${LIBNAME} PRIVATE address Boost::json)
The above pattern does not work for boost::asio. What is the right way to add header-only libraries to the include path?
You need to add Boost::asio to target_link_libraries.
Boost::asio
target_link_libraries
It works. Thank you, Peter.
I can use some boost libraries successfully using this pattern.
The above pattern does not work for boost::asio. What is the right way to add header-only libraries to the include path?