FindPython: reduces consumption of resources

Stores more information in the cache to reduce the number
of sub-processes required on subsequent find_package calls.

Fixes: #20337
This commit is contained in:
Marc Chevrier
2020-02-10 11:18:43 +01:00
parent ad17c37d34
commit 3dab4682f6
2 changed files with 139 additions and 89 deletions
@@ -10,6 +10,7 @@ if (NOT Python3_FOUND)
endif()
set (Python3_VIRTUAL_ENV "${CMAKE_CURRENT_BINARY_DIR}/py3venv")
file (REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/py3venv")
execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv "${Python3_VIRTUAL_ENV}"
RESULT_VARIABLE result