-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
- if (NOT Python3_FIND_STRATEGY)
- # If the user provides a hint for the Python installation with Python3_ROOT_DIR,
- # prevent FindPython3 from overriding the choice with a newer Python version
- # when CMP0094 is set to OLD.
- set(Python3_FIND_STRATEGY LOCATION)
- endif ()
- if(NOT Python3_FIND_VIRTUALENV)
- # We advocate using Python venvs to manage package availability, so by default
- # we want to preferentially discover user-space software.
- set(Python3_FIND_VIRTUALENV FIRST)
- endif()
-else()
- if(NOT Python3_FIND_REGISTRY)
- # We advocate using Python venvs to manage package availability, so by default
- # we want to preferentially discover user-space software.
- set(Python3_FIND_REGISTRY LAST)
- endif()
- # Make package discovery consistent with Unix behavior and our documented
- # suggestions for installing dependencies.
- set(CMAKE_FIND_FRAMEWORK LAST)
+if (NOT Python3_FIND_STRATEGY)
+ # If the user provides a hint for the Python installation with Python3_ROOT_DIR,
+ # prevent FindPython3 from overriding the choice with a newer Python version
+ # when CMP0094 is set to OLD.
+ set(Python3_FIND_STRATEGY LOCATION)