Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble importing libjson-rpc-cpp with CMake #296

Open
freesurfer-rge opened this issue Jun 7, 2020 · 1 comment
Open

Trouble importing libjson-rpc-cpp with CMake #296

freesurfer-rge opened this issue Jun 7, 2020 · 1 comment

Comments

@freesurfer-rge
Copy link

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?

@cafornaca
Copy link
Contributor

I'm wondering if I'm encountering a similar error:

$ make mkdir -p build
cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=Yes .. && make -j
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:13 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "filepath/libjson-rpc-cpp/build/libjson-rpc-cpp/build/CMakeFiles/CMakeOutput.log".
See also "filepath/libjson-rpc-cpp/build/libjson-rpc-cpp/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:9: build] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants