#!/usr/bin/env python # -*- coding: utf-8 -*- # This should be rewritten as a shell script from optparse import OptionParser import os p = OptionParser() p.add_option("-p", "--prefix", dest="prefix", help="Install prefix [default: /usr/local]", metavar="PREFIX", default="/usr/local") p.add_option("-i", "--interface", dest="interface", help="User interface [default: CLI. available: CLI, GTK2, QT4.]", metavar="INTERFACE", default="CLI") (opts, args) = p.parse_args() opts = dict(opts.__dict__) cmd = "cmake .. -DUI_%(interface)s=1 -DCMAKE_INSTALL_PREFIX=%(prefix)s" % opts os.system("mkdir -p build") retval = os.system("cd build && %s" % cmd) if retval == 0: print print "Configured successfully. To build: `cd build && make`" print "To clean up, remove the build dir."