Added cmake style config argument, which allows us to make it non-interactive.
This commit is contained in:
parent
9515338c75
commit
d85c266aa0
24
hm.py
24
hm.py
|
@ -130,9 +130,9 @@ def usage():
|
||||||
'Example: %s configure'
|
'Example: %s configure'
|
||||||
) % (this_cmd, this_cmd)
|
) % (this_cmd, this_cmd)
|
||||||
|
|
||||||
def configure():
|
def configure(generator = None):
|
||||||
|
|
||||||
err = configure_internal()
|
err = configure_internal(generator)
|
||||||
|
|
||||||
if err == 0:
|
if err == 0:
|
||||||
print ('Configure complete!\n\n'
|
print ('Configure complete!\n\n'
|
||||||
|
@ -143,9 +143,9 @@ def configure():
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def configure_internal():
|
def configure_internal(generator = None):
|
||||||
|
|
||||||
ensure_setup_latest()
|
ensure_setup_latest(generator)
|
||||||
|
|
||||||
generator = get_generator()
|
generator = get_generator()
|
||||||
if generator != '':
|
if generator != '':
|
||||||
|
@ -299,7 +299,7 @@ def package(type):
|
||||||
# Package is supported by default.
|
# Package is supported by default.
|
||||||
package_unsupported = False
|
package_unsupported = False
|
||||||
|
|
||||||
if type == '':
|
if type == None:
|
||||||
package_usage()
|
package_usage()
|
||||||
elif type == 'src-tgz':
|
elif type == 'src-tgz':
|
||||||
if sys.platform in ['linux2', 'darwin']:
|
if sys.platform in ['linux2', 'darwin']:
|
||||||
|
@ -332,7 +332,7 @@ def package(type):
|
||||||
else:
|
else:
|
||||||
package_unsupported = True
|
package_unsupported = True
|
||||||
else:
|
else:
|
||||||
print 'Not yet implemented: package %s' % package_type
|
print 'Not yet implemented: package %s' % type
|
||||||
|
|
||||||
if package_unsupported:
|
if package_unsupported:
|
||||||
print ('Package type, %s is not '
|
print ('Package type, %s is not '
|
||||||
|
@ -407,7 +407,7 @@ def main(argv):
|
||||||
arg_1 = argv[1]
|
arg_1 = argv[1]
|
||||||
completions = complete_command(arg_1)
|
completions = complete_command(arg_1)
|
||||||
|
|
||||||
arg_2 = ''
|
arg_2 = None
|
||||||
if len(argv) > 2:
|
if len(argv) > 2:
|
||||||
arg_2 = argv[2]
|
arg_2 = argv[2]
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ def main(argv):
|
||||||
if cmd in ['about', 'info']:
|
if cmd in ['about', 'info']:
|
||||||
about()
|
about()
|
||||||
elif cmd in ['configure', 'conf']:
|
elif cmd in ['configure', 'conf']:
|
||||||
configure()
|
configure(arg_2)
|
||||||
elif cmd in ['build']:
|
elif cmd in ['build']:
|
||||||
build(arg_2)
|
build(arg_2)
|
||||||
elif cmd in ['open']:
|
elif cmd in ['open']:
|
||||||
|
@ -486,9 +486,11 @@ def open_project_internal(project_filename, application = ''):
|
||||||
os.system(path)
|
os.system(path)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def setup():
|
def setup(generator = None):
|
||||||
print "Running setup..."
|
print "Running setup..."
|
||||||
|
|
||||||
|
# If no generator specified, prompt the user.
|
||||||
|
if generator == None:
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
generator = setup_generator_get(win32_generators)
|
generator = setup_generator_get(win32_generators)
|
||||||
elif sys.platform in ['linux2', 'sunos5', 'freebsd7']:
|
elif sys.platform in ['linux2', 'sunos5', 'freebsd7']:
|
||||||
|
@ -662,9 +664,9 @@ def run_vcbuild(generator, mode, args=''):
|
||||||
|
|
||||||
return os.system(temp_bat)
|
return os.system(temp_bat)
|
||||||
|
|
||||||
def ensure_setup_latest():
|
def ensure_setup_latest(generator = None):
|
||||||
if not has_setup_version(setup_version):
|
if not has_setup_version(setup_version):
|
||||||
setup()
|
setup(generator)
|
||||||
|
|
||||||
# Start the program.
|
# Start the program.
|
||||||
main(sys.argv)
|
main(sys.argv)
|
||||||
|
|
Loading…
Reference in New Issue