Linking cmake with system libraries on LFS
On my LFS I installed jsoncpp from https://github.com/open-source-parsers/jsoncpp/releases . This software piece is strange, in that it provides version 1.8.4 from 2017 and version 00.11.0 from 2020.
The “help string” for CMAKE_USE_SYSTEM_JSON_CPP does not provide information about any specific version, neither does the bundled README.rst mention something on this.
When I install 1.8.4 and tell cmake 1.17.2 to use it as system_json_cpp, during I configure cmake itself, it says:
Could NOT find JsonCpp (missing: JsonCpp_LIBRARY) (found suitable version "1.8.4", minimum required is "1.4.1") CMake Error at CMakeLists.txt:575 (message): CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found! Call Stack (most recent call first): CMakeLists.txt:710 (CMAKE_BUILD_UTILITIES)
ninja install from from jsoncpp itself does:
[0/1] Installing files. Installing libjsoncpp.so.20 to /usr/local/lib64 Installing /src/jsoncpp-1.8.4/include/json/allocator.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/assertions.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/autolink.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/config.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/features.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/forwards.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/json.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/reader.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/value.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/include/json/writer.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/build/version.h to /usr/local/include/json Installing /src/jsoncpp-1.8.4/build/meson-private/jsoncpp.pc to /usr/local/lib64/pkgconfig
When I install the version 00.11.0 (which in newer than version 1.8.4), cmake prints:
Could NOT find JsonCpp: Found unsuitable version "00.11.0", but required is at least "1.4.1" (found JsonCpp_LIBRARY-NOTFOUND) CMake Error at CMakeLists.txt:575 (message): CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found! Call Stack (most recent call first): CMakeLists.txt:710 (CMAKE_BUILD_UTILITIES)