Skip to content

Commit

Permalink
CMake python bindings: "use find_package (Python COMPONENTS Interpret…
Browse files Browse the repository at this point in the history
…er)" instead of deprecated "include(FindPythonInterp)"

Signed-off-by: Matej Kenda <[email protected]>
  • Loading branch information
matejk committed Sep 17, 2019
1 parent c0012d0 commit 96a9689
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 2.8.7)
project(libiio-py NONE)

include(FindPythonInterp)
find_package (Python COMPONENTS Interpreter)

if (PYTHONINTERP_FOUND)
if (Python_Interpreter_FOUND)
option(PYTHON_BINDINGS "Install Python bindings" ON)

if (PYTHON_BINDINGS)
Expand All @@ -15,10 +15,10 @@ if (PYTHONINTERP_FOUND)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/iio.py ${CMAKE_CURRENT_BINARY_DIR}/iio.py COPYONLY)

add_custom_target(libiio-py ALL DEPENDS ${SETUP_PY} COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} --quiet build)
add_custom_target(libiio-py ALL DEPENDS ${SETUP_PY} COMMAND ${Python_EXECUTABLE} ${SETUP_PY} --quiet build)

if(NOT SKIP_INSTALL_ALL)
install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX})")
install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${Python_EXECUTABLE} ${SETUP_PY} install --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX})")
endif()
endif()
endif()

0 comments on commit 96a9689

Please sign in to comment.