Skip to content

Trouble importing libjson-rpc-cpp with CMake #296

Description

@freesurfer-rge

I have been playing around a little with libjson-rpc-cpp, and I have a question about using the CMake config files which are provided.

Using the example on the homepage, I can manually compile and run it. I can also copy the FindMHD.cmake, FindJsonCpp.cmake files from the repo, hack together my own FindJsonRpcCpp.cmake based on them, and get a compile.

I then noticed the CMake config files installed in
/install/path/lib-json-rpc-cpp-1.3.0/lib64/libjson-rpc-cpp/cmake/
and I'm trying to figure out how to use them (since that seems preferable to hacking together my own).

With an appropriate CMAKE_PREFIX_PATH, I can have:

find_package(libjson-rpc-cpp CONFIG REQUIRED)

add_executable(SampleClient simpleclient.cpp)
target_link_libraries(SampleClient PUBLIC libjson-rpc-cpp::client)

and have CMake run quite happily. However, the compile fails, and on closer examination, none of the required -I options are being passed. I thought those were supposed to be added automatically by the target_link_libraries() command?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions