Skip to content

Couldn't add llhttp as dependency with cmake #222

@vdm4k

Description

@vdm4k

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} )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions