CMake: replace the deprecated find_package(PythonInterp) with find_package(Python2/3)
Closed this issue · 4 comments
Some CMake variable names will have to be changed, i.e. PYTHON2_EXECUTABLE will become Python2_EXECUTABLE, PYTHON2_LIBRARY will become Python2_LIBRARIES, etc.
Make sure to change this in function find_python within DetectPython.cmake as well as any other place
A lot of stuff in DetectPython.cmake seems in need of deprecation, i.e. Python3_SITEARCH and Python2_SITEARCH are found by CMake directly and don't have to be manually set using interpreter output on lines 160-189. Check out what they currently use in OpenCV, see if it's any better, and see what you can remove. Less code = better in this case.
This is not pertinent for now -- especially considering the FindPython2 and FindPython3 only appear in CMake 3.12 and a large portion of the world is using previous versions. However, this still needs to be done for CMake 3.12 and above to ensure a smooth transition.
This is unnecessary -- handled in DetectPython.cmake already