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

master
Aleric Inglewood 2010-08-27 17:32:41 +02:00
parent 838c01e87d
commit c4acbaf7c4
2 changed files with 16 additions and 12 deletions

View File

@ -64,6 +64,7 @@ Aleric Inglewood
VWR-12691
VWR-13996
VWR-14426
SNOW-766
Ales Beaumont
VWR-9352
Alissa Sabre

View File

@ -742,9 +742,10 @@ Options:
-p | --project=NAME set the root project name. (Doesn't effect makefiles)
Commands:
build configure and build default target
clean delete all build directories, does not affect sources
configure configure project by running cmake (default command if none given)
build configure and build default target
clean delete all build directories, does not affect sources
configure configure project by running cmake (default if none given)
printbuilddirs print the build directory that will be used
Command-options for "configure":
We use cmake variables to change the build configuration.
@ -762,15 +763,6 @@ Examples:
'''
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]()
try:
opts, args = getopt.getopt(
@ -832,6 +824,14 @@ For example: develop.py configure -DSERVER:BOOL=OFF"""
if cmd in ('cmake', 'configure'):
setup.run_cmake(args)
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():
if not os.path.exists(d):
raise CommandError('run "develop.py cmake" first')
@ -842,6 +842,9 @@ For example: develop.py configure -DSERVER:BOOL=OFF"""
if args:
raise CommandError('clean takes no arguments')
setup.cleanup()
elif cmd == 'printbuilddirs':
for d in setup.build_dirs():
print >> sys.stdout, d
else:
print >> sys.stderr, 'Error: unknown subcommand', repr(cmd)
print >> sys.stderr, "(run 'develop.py --help' for help)"