From 4805f09542e58f4d17202277527d6326fbcd27c3 Mon Sep 17 00:00:00 2001 From: Kai Hermann Date: Thu, 4 Jul 2024 11:06:03 +0200 Subject: [PATCH] Fail early if the python venv could not be created (#8) Signed-off-by: Kai-Uwe Hermann --- everest-cmake-config-version.cmake | 2 +- python-virtualenv.cmake | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/everest-cmake-config-version.cmake b/everest-cmake-config-version.cmake index 79f60a3..bdf702a 100644 --- a/everest-cmake-config-version.cmake +++ b/everest-cmake-config-version.cmake @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION 0.4.2) +set(PACKAGE_VERSION 0.4.3) if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) set(PACKAGE_VERSION_EXACT TRUE) diff --git a/python-virtualenv.cmake b/python-virtualenv.cmake index a19d062..166fec0 100644 --- a/python-virtualenv.cmake +++ b/python-virtualenv.cmake @@ -26,7 +26,11 @@ macro(ev_create_python_venv) execute_process( COMMAND ${Python3_EXECUTABLE} -m venv ${EV_CREATE_PYTHON_VENV_SYSTEM_SITE_PACKAGES_FLAG} ${EV_CREATE_PYTHON_VENV_PATH_TO_VENV} + RESULT_VARIABLE EV_CREATE_PYTHON_VENV_RESULT ) + if(${EV_CREATE_PYTHON_VENV_RESULT} AND NOT ${EV_CREATE_PYTHON_VENV_RESULT} EQUAL 0) + message(FATAL_ERROR "Could not create python venv: ${EV_CREATE_PYTHON_VENV_PATH_TO_VENV}") + endif() message(STATUS "Created python venv: ${EV_CREATE_PYTHON_VENV_PATH_TO_VENV}") endmacro()