From 6992a63cf8a611d1fea27e3f57c2ad40b06aabfb Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 11 May 2023 18:39:03 +0200 Subject: [PATCH] Don't search for PythonLibs when building pip/conda package Since python is linked statically there are no libraries --- CMakeLists.txt | 4 +++- cmake/SuperBuild.cmake | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9f4cca..9a18972a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) if(USE_PYTHON) find_package(PythonInterp 3 REQUIRED) - find_package(PythonLibs 3 REQUIRED) + if(NOT BUILD_FOR_CONDA) + find_package(PythonLibs 3 REQUIRED) + endif() execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1,0,''))" OUTPUT_VARIABLE PYTHON_PACKAGES_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) file(TO_CMAKE_PATH ${PYTHON_PACKAGES_INSTALL_DIR} PYTHON_PACKAGES_INSTALL_DIR) diff --git a/cmake/SuperBuild.cmake b/cmake/SuperBuild.cmake index 13d6915a..387f7b29 100644 --- a/cmake/SuperBuild.cmake +++ b/cmake/SuperBuild.cmake @@ -166,7 +166,9 @@ if (USE_PYTHON) message(FATAL_ERROR "Could NOT find pybind11!") endif( PYBIND_INCLUDE_DIR ) find_package(PythonInterp 3 REQUIRED) - find_package(PythonLibs 3 REQUIRED) + if(NOT BUILD_FOR_CONDA) + find_package(PythonLibs 3 REQUIRED) + endif() set_vars(NETGEN_CMAKE_ARGS PYTHON_INCLUDE_DIRS