Skip to content

Commit

Permalink
Update also cmake command
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed May 13, 2024
1 parent b4e4a66 commit daeb3a0
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/openalea/deploy/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit daeb3a0

Please sign in to comment.