From 272e9e19fcf74939bf73ff59c78d4aac35ce9d80 Mon Sep 17 00:00:00 2001 From: Nicolas Bigaouette Date: Tue, 12 Jan 2016 13:48:33 -0500 Subject: [PATCH] Force exact interpreter version found by find_package(PythonLibs) The call to `find_package(PythonLibs REQUIRED)` will set the `PYTHONLIBS_VERSION_STRING` variable (see the documentation at https://cmake.org/cmake/help/v3.0/module/FindPythonLibs.html) Use that value of the version for the call to `find_package(PythonInterp)` with `EXACT` flag added to enforce consistency between the Python interpreter, the linked Python library and the Python header. See !65. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 005bdc8fd..d8adc5abc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE) set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6) find_package(PythonLibs REQUIRED) -find_package(PythonInterp REQUIRED) +find_package(PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED) include(CheckCXXCompilerFlag)