Closed mknaranja closed 4 days ago
any comments here?
For me, more understandable and more universal approach with if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
described in issues/1451, suggested by @atrelinski
IMO PR https://github.com/open-source-parsers/jsoncpp/pull/1459 address this problem better and I am for merging PR https://github.com/open-source-parsers/jsoncpp/pull/1459 instead of this one
In https://github.com/open-source-parsers/jsoncpp/issues/1163#issuecomment-750770862, the author already warned that the setting of global cmake variables would cause troblems when using jsoncpp as a dependency with CMake.
As the problem in https://github.com/open-source-parsers/jsoncpp/issues/1163 was only related to Windows I first would propose to only do changes for windows and MSVC.
Furthermore, I made the global variables local by removing the CACHE keyword: https://riptutorial.com/cmake/example/11821/variables-and-the-global-variables-cache
I built jsoncpp on Windows with Cmake to see that it still works. There is another problem reported in https://github.com/open-source-parsers/jsoncpp/issues/1451 but that is not related as it was there on Windows before.