Skip to content
Snippets Groups Projects
Commit c4acbaf7 authored by Aleric Inglewood's avatar Aleric Inglewood
Browse files

SNOW-766: Add a 'printbuilddirs' command to develop.py

parent 838c01e8
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ Aleric Inglewood ...@@ -64,6 +64,7 @@ Aleric Inglewood
VWR-12691 VWR-12691
VWR-13996 VWR-13996
VWR-14426 VWR-14426
SNOW-766
Ales Beaumont Ales Beaumont
VWR-9352 VWR-9352
Alissa Sabre Alissa Sabre
......
...@@ -742,9 +742,10 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple): ...@@ -742,9 +742,10 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple):
-p | --project=NAME set the root project name. (Doesn't effect makefiles) -p | --project=NAME set the root project name. (Doesn't effect makefiles)
Commands: Commands:
build configure and build default target build configure and build default target
clean delete all build directories, does not affect sources clean delete all build directories, does not affect sources
configure configure project by running cmake (default command if none given) configure configure project by running cmake (default if none given)
printbuilddirs print the build directory that will be used
Command-options for "configure": Command-options for "configure":
We use cmake variables to change the build configuration. We use cmake variables to change the build configuration.
...@@ -762,15 +763,6 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple): ...@@ -762,15 +763,6 @@ def cmake_commandline(self, src_dir, build_dir, opts, simple):
''' '''
def main(arguments): def main(arguments):
if os.getenv('DISTCC_DIR') is None:
distcc_dir = os.path.join(getcwd(), '.distcc')
if not os.path.exists(distcc_dir):
os.mkdir(distcc_dir)
print "setting DISTCC_DIR to %s" % distcc_dir
os.environ['DISTCC_DIR'] = distcc_dir
else:
print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR')
setup = setup_platform[sys.platform]() setup = setup_platform[sys.platform]()
try: try:
opts, args = getopt.getopt( opts, args = getopt.getopt(
...@@ -832,6 +824,14 @@ def main(arguments): ...@@ -832,6 +824,14 @@ def main(arguments):
if cmd in ('cmake', 'configure'): if cmd in ('cmake', 'configure'):
setup.run_cmake(args) setup.run_cmake(args)
elif cmd == 'build': elif cmd == 'build':
if os.getenv('DISTCC_DIR') is None:
distcc_dir = os.path.join(getcwd(), '.distcc')
if not os.path.exists(distcc_dir):
os.mkdir(distcc_dir)
print "setting DISTCC_DIR to %s" % distcc_dir
os.environ['DISTCC_DIR'] = distcc_dir
else:
print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR')
for d in setup.build_dirs(): for d in setup.build_dirs():
if not os.path.exists(d): if not os.path.exists(d):
raise CommandError('run "develop.py cmake" first') raise CommandError('run "develop.py cmake" first')
...@@ -842,6 +842,9 @@ def main(arguments): ...@@ -842,6 +842,9 @@ def main(arguments):
if args: if args:
raise CommandError('clean takes no arguments') raise CommandError('clean takes no arguments')
setup.cleanup() setup.cleanup()
elif cmd == 'printbuilddirs':
for d in setup.build_dirs():
print >> sys.stdout, d
else: else:
print >> sys.stderr, 'Error: unknown subcommand', repr(cmd) print >> sys.stderr, 'Error: unknown subcommand', repr(cmd)
print >> sys.stderr, "(run 'develop.py --help' for help)" print >> sys.stderr, "(run 'develop.py --help' for help)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment