CMake: Fix WANT_PYTHON_VERSION not always being respected

This commit is contained in:
Sam Edwards 2020-01-08 20:57:33 -07:00
parent 3104bf3710
commit a1d43f7b88

View File

@ -171,6 +171,11 @@ if(DEFINED _PREV_WANT_PYTHON_VERSION
endif()
if(WANT_PYTHON_VERSION)
# A specific version is requested; ensure we get that specific version
list(APPEND WANT_PYTHON_VERSION "EXACT")
endif()
get_directory_property(_old_cache_vars CACHE_VARIABLES)
find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development)