From f83faf28b3424ba60c3bdc40d408011c9c619c8a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 11 Apr 2019 09:10:53 -0700 Subject: cmake: Remove ENABLE_PYTHON3 flag and simplify Python detection - Makes use of more modern find_package(Python2/3) if available - Moves almost all Python-related code to UHDPython.cmake - ENABLE_PYTHON3 is no longer necessary --- host/docs/build.dox.in | 6 ++---- host/docs/pythonapi.dox | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'host/docs') diff --git a/host/docs/build.dox.in b/host/docs/build.dox.in index 9e4f91ce4..1d9d9a0fe 100644 --- a/host/docs/build.dox.in +++ b/host/docs/build.dox.in @@ -220,10 +220,8 @@ extensions: \subsection cmake_win Generate the project with CMake -- Enable Python3 option in the CMake list if the version of installed Python is >=3, otherwise go to the next step. - - Go to the source code: `/host`. - - Open 'CMakeLists.txt'. - - Find 'ENABLE_PYTHON3' option and set it to 'ON', e.g. 'option(ENABLE_PYTHON3 "Enable Python 3. Default is Python 2" ON)'. +- Make sure the version of Python that CMake detects matches the version you + want it to be (check the PYTHON_VERSION variable) - Open the CMake GUI. - Set the path to the source code: `/host`. - Set the path to the build directory (this may require creating the folder \build\): `/host/build`. diff --git a/host/docs/pythonapi.dox b/host/docs/pythonapi.dox index 3f73c3a74..c8f504049 100644 --- a/host/docs/pythonapi.dox +++ b/host/docs/pythonapi.dox @@ -14,16 +14,16 @@ provide that functionality. On Windows, these headers always get installed when using the binary installers provided on https://www.python.org/downloads/windows/. If CMake can't find the Python headers or library, specify -the `PYTHON_INCLUDE_DIRS` and/or `PYTHON_LIBRARY` CMake variables manually. +the `PYTHON_INCLUDE_DIR` and/or `PYTHON_LIBRARY` CMake variables manually. \subsection python_install_2v3 Python 2 vs. 3 The Python API supports both Python 2 and 3, but if you have both versions installed, CMake might require some hints which version is the desired one. -To force Python 3, UHD has a CMake variable `ENABLE_PYTHON3`. If you set it, -e.g., by running `cmake -DENABLE_PYTHON3=ON`, it will force the usage of -Python 3. +To force a particular version, it helps to set `-DPYTHON_EXECUTABLE=/usr/bin/python3`, +or whatever interpreter you are expecting. The variables PYTHON_LIBRARY and +PYTHON_INCLUDE_DIR may also need to be set. \subsection python_install_windows Installing on Windows -- cgit v1.2.3