The BUILD.md document implies that re2c should be able to build without Python, but the CMake build has a hard requirement for Python. Fix the CMake build to match what BUILD.md says.
Move the initialization of the PYTHON variable up higher in the script so it is available sooner.
Only set the PYTHON variable if we find a suitable version of Python.
If we can't find Python, it's only an error if we are rebuilding docs.
If we can't find Python, don't add the test or check targets.
The BUILD.md document implies that re2c should be able to build without Python, but the CMake build has a hard requirement for Python. Fix the CMake build to match what BUILD.md says.