mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
16 lines
482 B
CMake
16 lines
482 B
CMake
|
|
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
|
if (NOT Python3_FOUND)
|
|
message (FATAL_ERROR "Failed to find Python 3")
|
|
endif()
|
|
|
|
file (REMOVE_RECURSE "${PYTHON3_VIRTUAL_ENV}")
|
|
|
|
execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv "${PYTHON3_VIRTUAL_ENV}"
|
|
RESULT_VARIABLE result
|
|
OUTPUT_VARIABLE outputs
|
|
ERROR_VARIABLE outputs)
|
|
if (result)
|
|
message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
|
|
endif()
|