Skip to content

Access to PYTHON_VERSION_MAJOR/MINOR #13

Description

@ax3l

When including pybind11 directly via add_subdirectory, the selected python interpreter would be useful to be queried, e.g. for install paths.

With find_package(pybind11) the variables PYTHON_VERSION_MAJOR and ..._MINOR leak into the caller's scope and can be queried, but add_subdirectory does proper encapsulation.

Can we maybe add PYTHON_VERSION_MAJOR and PYTHON_VERSION_MINOR as CMake target properties to the pybind11::pybind11 target? With that we could query it from a calling project (or maybe you have an alternative idea as well).

Activity

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