Commit 5b5e3de3 by Dean Moldovan Committed by Wenzel Jakob

Make Python version selection in CMake more convenient (#589)

This way a non-CACHE variable can also be used. For example:
```
set(PYBIND11_PYTHON_VERSION <value>)
add_subdirectory(...)
```
parent a9730be7
......@@ -8,7 +8,9 @@
cmake_minimum_required(VERSION 2.8.12)
# Add a CMake parameter for choosing a desired Python version
set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling modules")
if(NOT PYBIND11_PYTHON_VERSION)
set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling modules")
endif()
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment