Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python3 finding on OSX with -DUSE_PYTHON_VERSION=3 #529

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# 2016.12(09-Dec-2016)

* [529](https://github.com/Eyescale/CMake/pull/529):
Fix python3 finding on OSX with -DUSE_PYTHON_VERSION=3
* [527](https://github.com/Eyescale/CMake/pull/527):
Refactor INSTALL_PACKAGES out of SubProject.cmake, also fixing a bug that
the dependencies of a project were not installed if it did not have a
Expand Down
4 changes: 1 addition & 3 deletions ChoosePython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ if(${USE_PYTHON_VERSION} STREQUAL 3)
set(PYTHON_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2)
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2)
set(PythonLibs_FIND_VERSION 3)
set(PythonInterp_FIND_VERSION 3)
add_definitions(-DUSE_PYTHON3=1)
set(USE_BOOST_PYTHON_VERSION ${__boost_python_library_suffix})
# This shouldn't be necessary but helps detecting the Python libs
Expand All @@ -94,13 +93,12 @@ if(${USE_PYTHON_VERSION} STREQUAL 3)
endif()
else()
set(PythonLibs_FIND_VERSION 2)
set(PythonInterp_FIND_VERSION 2)
endif()

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