From b646f6317c4de203f80faec71441445b120ba649 Mon Sep 17 00:00:00 2001 From: Nick Rhinehart Date: Sun, 12 Jun 2016 14:29:11 -0400 Subject: [PATCH] Detection of PYBIND11 python version logic tweak --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d2c991ab1..7127e1a33c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,11 @@ option(PYBIND11_INSTALL "Install pybind11 header files?" ${PYBIND11_MASTER_PROJE option(PYBIND11_TEST "Build pybind11 test suite?" ${PYBIND11_MASTER_PROJECT}) # Add a CMake parameter for choosing a desired Python version -set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling the example application") +if(DEFINED PYBIND11_PYTHON_VERSION) + set(PYBIND11_PYTHON_VERSION ${PYBIND11_PYTHON_VERSION} CACHE STRING "Python version to use for compiling the example application") +else() + set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling the example application") +endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/tools") set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7)