Skip to content

Instantly share code, notes, and snippets.

@eblot
Created August 19, 2019 16:51
Show Gist options
  • Save eblot/38dd337fcc3fae103bee4344f95a17ab to your computer and use it in GitHub Desktop.
Save eblot/38dd337fcc3fae103bee4344f95a17ab to your computer and use it in GitHub Desktop.
libiio: Force Python3 bindings
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 4ba6aca..74bf610 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 2.8.7)
project(libiio-py NONE)
-include(FindPythonInterp)
+include(FindPython3)
-if (PYTHONINTERP_FOUND)
+if (Python3_Interpreter_FOUND)
option(PYTHON_BINDINGS "Install Python bindings" ON)
if (PYTHON_BINDINGS)
@@ -12,10 +12,10 @@ if (PYTHONINTERP_FOUND)
configure_file(${SETUP_PY_IN} ${SETUP_PY})
- 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 ${Python3_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 ${Python3_EXECUTABLE} ${SETUP_PY} install --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX})")
endif()
endif()
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment