Write cmake_output under build_path (#222)
Write cmake_output under build_path
This commit is contained in:
parent
2e587b5b39
commit
9953b6559d
@ -18,7 +18,8 @@ def check_cmake_exists(cmake_command):
|
||||
"""
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
p = Popen('{0} --version'.format(cmake_command),
|
||||
p = Popen(
|
||||
'{0} --version'.format(cmake_command),
|
||||
shell=True,
|
||||
stdin=PIPE,
|
||||
stdout=PIPE)
|
||||
@ -41,8 +42,11 @@ def setup_build_path(build_path):
|
||||
fname = os.path.join(build_path, 'CMakeCache.txt')
|
||||
if os.path.exists(fname):
|
||||
sys.stderr.write('aborting setup\n')
|
||||
sys.stderr.write('build directory {0} which contains CMakeCache.txt already exists\n'.format(build_path))
|
||||
sys.stderr.write('remove the build directory and then rerun setup\n')
|
||||
sys.stderr.write(
|
||||
'build directory {0} which contains CMakeCache.txt already exists\n'.
|
||||
format(build_path))
|
||||
sys.stderr.write(
|
||||
'remove the build directory and then rerun setup\n')
|
||||
sys.exit(1)
|
||||
else:
|
||||
os.makedirs(build_path, 0o755)
|
||||
@ -56,11 +60,7 @@ def run_cmake(command, build_path, default_build_path):
|
||||
from shutil import rmtree
|
||||
|
||||
topdir = os.getcwd()
|
||||
p = Popen(command,
|
||||
shell=True,
|
||||
stdin=PIPE,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE)
|
||||
p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
stdout_coded, stderr_coded = p.communicate()
|
||||
stdout = stdout_coded.decode('UTF-8')
|
||||
stderr = stderr_coded.decode('UTF-8')
|
||||
@ -75,7 +75,7 @@ def run_cmake(command, build_path, default_build_path):
|
||||
sys.stderr.write(stderr)
|
||||
|
||||
# write cmake output to file
|
||||
with open('cmake_output', 'w') as f:
|
||||
with open(os.path.join(build_path, 'cmake_output'), 'w') as f:
|
||||
f.write(stdout)
|
||||
|
||||
# change directory and return
|
||||
|
Loading…
x
Reference in New Issue
Block a user