Closed
Description
Dear jsoncpp developers,
I tried to use the CMake package built by jsoncpp
(and provided by libjsoncpp-dev
on Debian / Ubuntu) on a CMake project depending on it.
I tried the following discovery via CMake config mode:
find_package(jsoncpp REQUIRED)
include_directories(${jsoncpp_INCLUDE_DIRS})
link_libraries(${jsoncpp_LIBRARIES})
But it does not seem to work. I then ran the the following test:
cmake_minimum_required(VERSION 2.6.2)
project(jsoncpp_test)
find_package(jsoncpp REQUIRED)
message("FOUND CONFIG: ${jsoncpp_CONFIG}")
message("INCLUDE DIRS: ${jsoncpp_INCLUDE_DIRS}")
message("LIBRARIES: ${jsoncpp_LIBRARIES}")
which produced the following output:
FOUND CONFIG: /usr/lib/x86_64-linux-gnu/cmake/jsoncpp/jsoncppConfig.cmake
INCLUDE DIRS:
LIBRARIES:
meaning the CMake package file is found but none of the expected variables is set.
How are we expected to discover and use jsoncpp
under CMake then? FYI, using pkg-config works fine, but is not what I would consider a solution.
Many thanks,
Ghis