Skip to content

WIP: FindPython: Minimize python interpreter executions

Frank Winklmeier requested to merge fwinkl/cmake:pyconfig into master

A typical call to FindPython spawns around 10 python processes in order to extract various pieces of information (version, abi flags, copyright, etc.) and can have a noticeable impact on configuration times i.e. for large projects that may contain multiple of these calls.

Instead of spawning the interpreter each time, introduce a pyconfig.py script that dumps all relevant information as cmake variables (e.g. PYCONFIG_VERSION_MAJOR) into a pyconfig.cmake file that is included in FindPython.

Before moving this further along and fix the remaining places, I would like to get some feedback from experts if this is a viable solution at all.

Merge request reports