From f4f8322a80aa80248d70f6dc1f6957de39de044a Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 2 Nov 2020 11:03:05 -0800 Subject: [PATCH] Build: Require exact version if PYTHON_VERSION is specified (#1286) Signed-off-by: Larry Gritz --- src/cmake/pythonutils.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmake/pythonutils.cmake b/src/cmake/pythonutils.cmake index 87a25def3..48d94e336 100644 --- a/src/cmake/pythonutils.cmake +++ b/src/cmake/pythonutils.cmake @@ -20,10 +20,12 @@ macro (find_python) # Attempt to find the desired version, but fall back to other # additional versions. + unset (_req) if (USE_PYTHON) set (_req REQUIRED) - else () - unset (_req) + if (PYTHON_VERSION) + list (APPEND _req EXACT) + endif () endif () checked_find_package (Python ${PYTHON_VERSION} ${_req}