Skip to content

The second find_package will cause error #2376

Open

Description

@wsw364321644

# RapidJSON build dir
set( RapidJSON_DIR "@CONFIG_DIR@")

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

Activity

  1. Shubham-Padkonde commented on Sep 17, 2026

    @Shubham-Padkonde

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions