Skip to content

FindNewPython's forces check against PYTHON_EXECUTABLE during configuration phase #236

@tony

Description

@tony

A recent change to pybind11 does checks against a python interpreter. The verification done for FindPythonLibs doesn’t apply in the case of superbuilt python (ExternalProject_Add) since the PYTHON_EXECUTABLE isn't ready until compile time.

In my circumstances, I already have ${PYTHON_LIBRARY} and ${PYTHON_INCLUDE_DIR} set. CMake's FindPythonLibs allows you to specify your versions:

If you'd like to specify the installation of Python to use, you should
modify the following cache variables:

     PYTHON_LIBRARY             - path to the python library
     PYTHON_INCLUDE_DIR         - path to where Python.h is found

Expected behavior: FindPythonLibsNew.cmake should skip execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" and/or fallback to find_package(PythonLibs) behavior if PYTHON_LIBRARY and PYTHON_INCLUDE_DIR is already set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions