specify specific python3 version when multiple versions are installed (prefer command line parameters)
I would like to specify a particular python3 version to be used to build a project. There are multiple python3 versions installed (all in the same PYTHON3_ROOT_DIR, /usr/local).
It is not my project, so I prefer not to have to edit CMakeLists.txt files. That is, I prefer to pass arguments on the command line to specify the desired version. The project's CMakeLists.txt uses 'find_package(Python3)'.
It appears there is no way to do this with the existing FindPython3.cmake (or I could not figure it out).
Furthermore if I do edit the CMakeLists.txt file and use 'find_package(Python3 3.8 EXACT)' when both 3.8 and 3.10 are installed, I get:
-- Could NOT find Python3: Found unsuitable version "3.10.2", but required is exact version "3.8" (found /usr/local/bin/python3.10, found components: Interpreter)
cmake-3.22.1
OS: FreeBSD
I referenced these issues which did not help: #22515 (closed) #19076 (closed)