Go to the documentation of this file.00001 import os
00002 import sys
00003 import roslib
00004 import sipconfig
00005 from PyQt4 import pyqtconfig
00006
00007 if len(sys.argv) != 8:
00008 print 'usage: %s build-dir sip-file output_dir include_dirs libs lib_dirs ldflags' % (sys.argv[0])
00009 exit(1)
00010
00011
00012 build_dir, sip_file, output_dir, include_dirs, libs, lib_dirs, ldflags = sys.argv[1:]
00013
00014
00015 build_file = 'pyqtscripting.sbf'
00016
00017
00018 config = pyqtconfig.Configuration()
00019
00020
00021
00022
00023 qt_sip_flags = config.pyqt_sip_flags
00024
00025 try:
00026 os.makedirs(build_dir)
00027 except OSError:
00028 pass
00029
00030
00031
00032 os.system(' '.join([
00033 config.sip_bin,
00034 '-c', build_dir,
00035 '-b', os.path.join(build_dir, build_file),
00036 '-I', config.pyqt_sip_dir,
00037 '-w',
00038 qt_sip_flags,
00039 sip_file
00040 ]))
00041
00042
00043
00044
00045 makefile = pyqtconfig.QtGuiModuleMakefile(
00046 dir=build_dir,
00047 configuration=config,
00048 build_file=build_file
00049 )
00050
00051 for include_dir in include_dirs.split(' '):
00052 makefile.extra_include_dirs.append(include_dir)
00053 for lib in libs.split(' '):
00054 makefile.extra_libs.append(lib)
00055 for lib_dir in lib_dirs.split(' '):
00056 makefile.extra_lib_dirs.append(lib_dir)
00057 for ldflag in ldflags.split('\\ '):
00058 makefile.LFLAGS.append(ldflag)
00059
00060
00061 makefile._target = os.path.join(output_dir, makefile._target)
00062
00063
00064 makefile.generate()