From patchwork Mon Nov 13 13:00:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Morey-Chaisemartin X-Patchwork-Id: 10056011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 65DDC60215 for ; Mon, 13 Nov 2017 13:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CB0929135 for ; Mon, 13 Nov 2017 13:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5016429252; Mon, 13 Nov 2017 13:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B111929255 for ; Mon, 13 Nov 2017 13:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752949AbdKMN0J (ORCPT ); Mon, 13 Nov 2017 08:26:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:49572 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754232AbdKMNAR (ORCPT ); Mon, 13 Nov 2017 08:00:17 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 34B09AB22 for ; Mon, 13 Nov 2017 13:00:16 +0000 (UTC) From: Nicolas Morey-Chaisemartin Subject: [PATCH rdma-core 1/2] buildlib: use cmake to find python To: linux-rdma@vger.kernel.org Openpgp: preference=signencrypt Message-ID: <1923c475-0597-a597-36a5-8a33cccae6ef@suse.de> Date: Mon, 13 Nov 2017 14:00:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 MIME-Version: 1.0 Content-Language: fr-xx-classique+reforme1990 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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