[go: up one dir, main page]

Menu

[r710]: / trunk / cppdom-config  Maximize  Restore  History

Download this file

42 lines (32 with data), 1.4 kB

#!/usr/bin/env python

import os, sys
from optparse import OptionParser

parser = OptionParser(usage="%prog [OPTIONS]", description="Cppdom config option processor.")

parser.add_option("--prefix",action="store_true",help="Print the installation prefix.")
parser.add_option("--version",action="store_true",help="Print the installed CppDom's version number.")
parser.add_option("--cxxflags",action="store_true",help="Pring the CppDom-specific flags for the C++ compiler.")
parser.add_option("--libs",action="store_true",help="Pring the CppDom specific libraries.")
parser.add_option("--all",action="store_true",help="Print all the flags used for compiling or linking.")
parser.add_option("--basedir",action="store_true",help="For compatibility. (disabled in this wrapper)")

(options, pos_args) = parser.parse_args()

if 0 != len(pos_args):
   parser.print_help()

# Build up flags for flagpoll
command_flags = " cppdom --concat"

if options.prefix:
   command_flags += " --get-prefix"
elif options.version:
   command_flags += " --modversion"
elif options.cxxflags or options.libs:
   if options.cxxflags:
      command_flags += " --cflags"
   if options.libs:
      command_flags += " --libs"
   if not options.all:
      command_flags += " --no-deps"
else:
   parser.print_help()
   sys.exit(1)      
   
command_line = "flagpoll " + command_flags

#print "Command: ", command_line
os.system(command_line)