FindPython's Development.Module component requires "LIBRARY" in the artifacts list
In my current environment find_package(Python REQUIRED COMPONENT Development.Module)
currently fails with Could NOT find Python (missing: Development.Module)
. The reason for this failure can be traced through the following parts of the code:
-
LIBRARY
is currently only added to_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS
) on Windows - Without
LIBRARY
in that list, we never enter this conditional block - Without entering that block, we never call
_python_get_version
- Without that function call, we don't have all the variables set for this conditional, which in turn means that we don't set
${_PYTHON_PREFIX}_Development.Module_FOUND
toTRUE
.
I am not sure whether there is something in my current environment that is causing this issue, but the Windows-specific conditional that I've removed seemed a bit odd to me. Also, it seems like to a large extent _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS
and _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_EMBED_ARTIFACTS
could maybe just be combined, but I'm afraid I don't know this code well enough to say for sure. A lot of this code seems to trace back to the changes in !4616 (merged), so I assume that refactoring has significant bearing on deciding whether or not my solution here is correct.