Skip to content

Commit 3d5d284

Browse files
authored
Fix python3 finding on OSX with -DUSE_PYTHON_VERSION=3 (#529)
1 parent 0aff536 commit 3d5d284

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# 2016.12(09-Dec-2016)
44

5+
* [529](https://github.com/Eyescale/CMake/pull/529):
6+
Fix python3 finding on OSX with -DUSE_PYTHON_VERSION=3
57
* [527](https://github.com/Eyescale/CMake/pull/527):
68
Refactor INSTALL_PACKAGES out of SubProject.cmake, also fixing a bug that
79
the dependencies of a project were not installed if it did not have a

ChoosePython.cmake

+1-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ if(${USE_PYTHON_VERSION} STREQUAL 3)
7979
set(PYTHON_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2)
8080
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2)
8181
set(PythonLibs_FIND_VERSION 3)
82-
set(PythonInterp_FIND_VERSION 3)
8382
add_definitions(-DUSE_PYTHON3=1)
8483
set(USE_BOOST_PYTHON_VERSION ${__boost_python_library_suffix})
8584
# This shouldn't be necessary but helps detecting the Python libs
@@ -94,13 +93,12 @@ if(${USE_PYTHON_VERSION} STREQUAL 3)
9493
endif()
9594
else()
9695
set(PythonLibs_FIND_VERSION 2)
97-
set(PythonInterp_FIND_VERSION 2)
9896
endif()
9997

10098
if(NOT PYTHON_EXECUTABLE)
10199
# Regardless of auto-detection, now we need to find the interpreter to
102100
# query the library suffix.
103-
find_package(PythonInterp QUIET)
101+
find_package(PythonInterp ${USE_PYTHON_VERSION} QUIET)
104102
endif()
105103
execute_process(COMMAND
106104
${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1,0,prefix=''))"

0 commit comments

Comments
 (0)