You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am very interested in using your library. I would like to use FetchContent and have access to your library through add_subdirectory. However, your library does not create a convenience target to use with target_link_libraries. While it is little effort for me to add the necessary include directory myself, I would much rather just "link" against your header only library like so:
target_link_libraries(MyTarget PRIVATE Boost::ut)
I have included an import prefix to mirror Boost's component linking behavior.
Defining an interface library through CMake with the appropriate include directories will make this possible.
The changes might look like the following.
add_library(ut INTERFACE)
add_library(Boost::ut ALIAS ut)
target_include_directories(ut INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
This code also paves the way for the interface target to be exported and included with find_package.
The text was updated successfully, but these errors were encountered:
I am very interested in using your library. I would like to use
FetchContent
and have access to your library throughadd_subdirectory
. However, your library does not create a convenience target to use withtarget_link_libraries
. While it is little effort for me to add the necessary include directory myself, I would much rather just "link" against your header only library like so:I have included an import prefix to mirror Boost's component linking behavior.
Defining an interface library through CMake with the appropriate include directories will make this possible.
The changes might look like the following.
This code also paves the way for the interface target to be exported and included with
find_package
.The text was updated successfully, but these errors were encountered: