CMake USE_SYSTEM_... setup broken, wrong variable scope

Open
#221 0 comments 0 reactions 1 assignee View on GitHub

@Mizux is already working on this.

Since Jul 27, 2026.

Assessment

This issue has not been assessed yet.

Description

bug dependencies

Any use of the USE_SYSTEM_{ABSEIL,PYBIND,PROTOBUF} will not work.

Using find_package(...) in a subdirectory scope via add_directory(...) will make any defined variables and targets available in this scope, but not in the toplevel scope as intended.

The correct way is to use include(...) instead of add_directory(...), as that will work in the callers scope.

Dominant language
C++
Stars
67
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pybind/pybind11_protobuf

All issues in pybind/pybind11_protobuf

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.