Skip to content

Commit

Permalink
gh-327: Use "include(FindPythinInterp)" when compiling with CMake old…
Browse files Browse the repository at this point in the history
…er than 3.12.

Signed-off-by: Matej Kenda <[email protected]>
  • Loading branch information
matejk committed Dec 11, 2019
1 parent 1036e51 commit 5ca77b1
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 5ca77b1

Please sign in to comment.