Please, move this into cmake/OpenCVDetectPython.cmake, alongside the search for `sphinx-build`. Also, do you really have to uncache the variable? I mean, it's specifically cached so that you don't have to repeat the search every time you rerun CMake.