From daeb3a08da67fe2bd680b62294ae20f789c6c7f5 Mon Sep 17 00:00:00 2001 From: pradal Date: Mon, 13 May 2024 11:46:09 +0200 Subject: [PATCH] Update also cmake command --- src/openalea/deploy/command.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/openalea/deploy/command.py b/src/openalea/deploy/command.py index d44af0b..ea5be23 100644 --- a/src/openalea/deploy/command.py +++ b/src/openalea/deploy/command.py @@ -413,11 +413,6 @@ def run(self): if (not self.scons_scripts): return - # try to import subprocess package - import subprocess - subprocess_enabled = True - - # run each scons script from setup.py for s in self.scons_scripts: try: @@ -512,13 +507,6 @@ def run(self): if (not self.cmake_scripts): return - # try to import subprocess package - try: - import subprocess - subprocess_enabled = True - except ImportError: - subprocess_enabled = False - # run each CMake script from setup.py for s in self.cmake_scripts: try: @@ -536,13 +524,10 @@ def run(self): if not os.path.isdir('build-cmake'): os.mkdir('build-cmake') - os.chdir('build-cmake') - # Run CMake - if (subprocess_enabled): - retval = subprocess.call(commandstr, shell=True) - else: - retval = os.system(commandstr) + command_line = shlex.split(commandstr) + result = subprocess.run(command_line, cwd='build-cmake', shell=True, timeout=None) + retval = result.returncode # Test if command success with return value if (retval != 0):