open-source-parsers / jsoncpp

A C++ library for interacting with JSON.
Other
8.06k stars 2.63k forks source link

Use current source / binary dir when assuring out of source builds #1527

Open appgurueu opened 7 months ago

appgurueu commented 7 months ago

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.