[PATCH rdma-core 1/2] buildlib: use cmake to find python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Depending on the system, python might not be available as pythomn (but python2, python3, etc.)
Use FIND_PACKAGE to get the right executable.

Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@xxxxxxxx>
---
 CMakeLists.txt                | 3 +++
 buildlib/rdma_functions.cmake | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e6f245a..a283fba3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -279,6 +279,9 @@ else()
   set(HAVE_FULL_SYMBOL_VERSIONS 1)
 endif()
 
+# Look for Python
+FIND_PACKAGE (PythonInterp)
+
 #-------------------------
 # Find libraries
 # pthread
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
index d69afd3d..53a978e8 100644
--- a/buildlib/rdma_functions.cmake
+++ b/buildlib/rdma_functions.cmake
@@ -144,7 +144,7 @@ function(rdma_shared_provider DEST VERSION_SCRIPT SOVERSION VERSION)
   install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
 
   # Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR
-  execute_process(COMMAND python ${CMAKE_SOURCE_DIR}/buildlib/relpath
+  execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/buildlib/relpath
     "${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}"
     "${VERBS_PROVIDER_DIR}"
     OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
-- 
2.15.0.167.g7819e496d


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux