pyenv is a rather common virtualization tool in Python (15% of people that use venvs use pyenv) and it creates a global shim for every binary that is installed in any virtual env. When you are in an env that doesn’t have cython installed, the shim is still active but produces the following output if invoked:
pyenv: cython: command not found
The `cython' command exists in these Python versions:
3.9.1
For some reason CMake’s find_package
still accepts this script, that always echoes that output as a valid “Cython”, even when ludicrous version requirements are given:
find_package(Cython 500.10 REQUIRED)
-- Found Cython: /home/robin/.pyenv/shims/cython (Required is at least version "500.10")
And later on in the build this ofcourse causes errors. From this it seems like CMake isn’t even trying to determine the version … How does find_package
usually determine the version and what can I do to make CMake check that some random executable file it finds called “cython” actually is a Cython of the correct version?