Skip to content

Conversation

@tafilz
Copy link

@tafilz tafilz commented Jan 24, 2026

This PR removes ${PYTHON_INCLUDE_DIRS} from the target interface.

In BitBake builds the variable added a hard‑coded Python include directory to the generated Targets.cmake file (e.g. in whinlatter with python3.13):

set_target_properties(pybind11_json PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/usr/include/python3.13;${_IMPORT_PREFIX}/include"
)

Which causes to fail in BitBake builds with:

| CMake Error in CMakeLists.txt:
|   Imported target "pybind11_json" includes non-existent path
| 
|     "/usr/include/python3.13"
| 
|   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
| 
|   * The path was deleted, renamed, or moved to another location.
| 
|   * An install or uninstall procedure did not complete successfully.
| 
|   * The installation package was faulty and references files it does not
|   provide.

Python‑related includes are already handled by pybind11.

Including PYTHON_INCLUDE_DIRS in the INTERFACE list caused a hard-coded
Python include directory (e.g. /usr/include/python3.13) to appear in the
generated Targets.cmake file. This resulted in a CMake configuration
error when the path did not exist:

    Imported target "pybind11_json" includes non-existent path
      "/usr/include/python3.13"

pybind11_json is header-only and does not use Python headers, so the
include path should not be exported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant