From df1c515a57876c6718e9f89daeab64c509061b4f Mon Sep 17 00:00:00 2001 From: Roland Kaminski Date: Thu, 15 Feb 2024 18:35:36 +0100 Subject: [PATCH] use python extensions to build pip packages --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ea641e..fabeb86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,9 +161,14 @@ if (PYCLINGOLPX_ENABLE) if (PYCLINGOLPX_ENABLE STREQUAL "require" OR PYCLINGOLPX_ENABLE STREQUAL "pip") set(_args ${_args} REQUIRED) endif() - find_package(PythonInterp ${_args}) - find_package(PythonLibs ${_args}) + if (PYCLINGOLPX_ENABLE STREQUAL "pip") + find_package(PythonExtensions ${_args}) + else() + find_package(PythonInterp ${_args}) + find_package(PythonLibs ${_args}) + endif() set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}") + set(Python_VERSION_MAJOR "${PYTHON_VERSION_MAJOR}") if (PYTHONLIBS_FOUND) add_library(Python::Python INTERFACE IMPORTED) add_library(Python::Module INTERFACE IMPORTED)