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

gh-327: Use "include(FindPythinInterp)" when compiling with CMake older than 3.12 #328

Merged
merged 1 commit into from
Jan 10, 2020
Merged
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
11 changes: 10 additions & 1 deletion bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
cmake_minimum_required(VERSION 2.8.7)
project(libiio-py NONE)

find_package (Python COMPONENTS Interpreter)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
include(FindPythonInterp)

# Set variables as they would be set by module FindPython,
# which is available from CMake 3.12.
set(Python_Interpreter_FOUND ${PYTHONINTERP_FOUND})
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
else()
find_package (Python COMPONENTS Interpreter)
endif()

if (Python_Interpreter_FOUND)
option(PYTHON_BINDINGS "Install Python bindings" ON)
Expand Down