Currently jsoncpp checks whether $CMAKE_SOURCE_DIR equals CMAKE_BINARY_DIR. If you use jsoncpp by fetching it via FetchContent, jsoncpp is not the root project. Thus jsoncpp then mandates out of source builds for the root project, which is rude; it should only check that its own build is happening out of source. Hence use the CURRENT variables instead of the "toplevel" ones.
Currently jsoncpp checks whether
$CMAKE_SOURCE_DIR
equalsCMAKE_BINARY_DIR
. If you use jsoncpp by fetching it viaFetchContent
, jsoncpp is not the root project. Thus jsoncpp then mandates out of source builds for the root project, which is rude; it should only check that its own build is happening out of source. Hence use theCURRENT
variables instead of the "toplevel" ones.