-
-
Notifications
You must be signed in to change notification settings - Fork 223
Description
I've tried to use llhttp as dependency for my project and follow this instruction -
FetchContent_Declare(llhttp
URL "https://github.com/nodejs/llhttp/archive/refs/tags/v6.0.5.tar.gz") # Using version 6.0.5
FetchContent_MakeAvailable(llhttp)
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME})
But it doesn't work
The problem is that project didn't propagate headers folder. -
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include )
I've modified it to -
target_include_directories(${target} SYSTEM PUBLIC $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include> )
And now it works good
PS also maybe this will be better
target_include_directories(${target} SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )