rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

The second find_package will cause error

Open wsw364321644 opened this issue 7 months ago • 1 comments

https://github.com/Tencent/rapidjson/blob/24b5e7a8b27f42fa16b96fc70aade9106cf7102f/RapidJSONConfig.cmake.in#L10-L12

cmake 用<PackageName>_DIR 存储configuration file的目录。 RapidJSON_DIR被覆盖后会报错。

wsw364321644 avatar Apr 21 '26 04:04 wsw364321644

Reproduced on current master with an installed package: the first find_package(RapidJSON CONFIG REQUIRED) overwrites RapidJSON_DIR with the producer build directory; the second lookup then tries to include a nonexistent RapidJSON-targets.cmake from that directory. I am preparing a narrow fix that preserves CMake discovery state, plus a repeated-discovery consumer regression. The broader open CMake PR #2340 also edits this variable, but still overwrites it. Prepared with Codex assistance.

Shubham-Padkonde avatar Sep 17 '26 03:09 Shubham-Padkonde