Browse Source

CMake: Fix WANT_PYTHON_VERSION not always being respected

Sam Edwards 6 years ago
parent
commit
a1d43f7b88
1 changed files with 5 additions and 0 deletions
  1. 5 0
      dtool/Package.cmake

+ 5 - 0
dtool/Package.cmake

@@ -171,6 +171,11 @@ if(DEFINED _PREV_WANT_PYTHON_VERSION
 
 
 endif()
 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)
 get_directory_property(_old_cache_vars CACHE_VARIABLES)
 find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development)
 find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development)