Skip to content

How to link jsoncpp library in cmake project #927

Closed
@ParikaGoel

Description

@ParikaGoel

The jsoncppConfig.cmake defines property INTERFACE_INCLUDE_DIRECTORIES for targets jsoncpp_lib and jsoncpp_lib_static.

You need to query the target property and set it manually:

get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
include_directories(${JSON_INC_PATH})

Linking is done via:

target_link_libraries(${PROJECT_NAME} jsoncpp_lib)

Originally posted by @christian-rauch in #455 (comment)

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