Commit f1121264 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

prepare.py: stop generation if working directory already exists to avoid...

prepare.py: stop generation if working directory already exists to avoid conflicts between multiple executions
parent ebdae123
......@@ -176,8 +176,12 @@ def run(target, debug, latest, list_cmake_variables, additional_args):
build_type = 'Debug'
work_dir = 'WORK/cmake-' + target.name
if not os.path.isdir(work_dir):
os.makedirs(work_dir)
if os.path.isdir(work_dir):
print("Working directory {} already exists. Please remove it (option -C or -c) before re-executing CMake "
"to avoid conflicts between executions.".format(work_dir))
return 1
os.makedirs(work_dir)
proc = subprocess.Popen(target.cmake_command(build_type, latest, list_cmake_variables, additional_args), cwd=work_dir, shell=False)
proc.communicate()
return proc.returncode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment