Don't use build dir build interfaces - Fix use with CMake FetchContent by matthieugleg · Pull Request #1528 · open-source-parsers/jsoncpp (original) (raw)

This is an updated version of #1419
Fix the issue :

 Imported target "Jsoncpp_lib" includes non-existent path

    "build/_deps/jsoncpp-build/include/json"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

To reproduce, import jsoncpp like that :

FetchContent_Declare(
        jsoncpp
        GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp.git
        GIT_TAG 1.9.5
)
FetchContent_MakeAvailable(jsoncpp)