mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-27 23:52:00 +00:00
CMake: Remember Python Version (#1434)
It is useful not only to remember the python libs and includes but also the interpreter version in cache. If users call pybind11 throught `add_subdirectories` they will otherwise have no access to the selected interpreter version. The interpreter version is useful for downstream projects, e.g. to select default `lib/pythonX.Y/site-packages/` install paths.
This commit is contained in:
parent
f52b46c5f7
commit
13043957ce
@ -38,6 +38,8 @@ set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} CACHE INTERNAL "")
|
||||
set(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} CACHE INTERNAL "")
|
||||
set(PYTHON_MODULE_PREFIX ${PYTHON_MODULE_PREFIX} CACHE INTERNAL "")
|
||||
set(PYTHON_MODULE_EXTENSION ${PYTHON_MODULE_EXTENSION} CACHE INTERNAL "")
|
||||
set(PYTHON_VERSION_MAJOR ${PYTHON_VERSION_MAJOR} CACHE INTERNAL "")
|
||||
set(PYTHON_VERSION_MINOR ${PYTHON_VERSION_MINOR} CACHE INTERNAL "")
|
||||
|
||||
# NB: when adding a header don't forget to also add it to setup.py
|
||||
set(PYBIND11_HEADERS
|
||||
|
Loading…
Reference in New Issue
Block a user