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)