Go to the documentation of this file.00001 import os
00002 import sys
00003 import roslib
00004 import sipconfig
00005 import subprocess
00006 from PyQt4 import pyqtconfig
00007
00008 if len(sys.argv) != 4:
00009 print 'usage: %s build-dir sip-file output_dir' % (sys.argv[0])
00010 exit(1)
00011
00012
00013 build_dir, sip_file, output_dir = sys.argv[1:]
00014
00015
00016 build_file = 'pyqtscripting.sbf'
00017
00018
00019 config = pyqtconfig.Configuration()
00020
00021
00022
00023
00024 qt_sip_flags = config.pyqt_sip_flags
00025
00026 try:
00027 os.makedirs(build_dir)
00028 except OSError:
00029 pass
00030
00031
00032
00033 os.system(' '.join([
00034 config.sip_bin,
00035 '-c', build_dir,
00036 '-b', os.path.join(build_dir, build_file),
00037 '-I', config.pyqt_sip_dir,
00038 '-w',
00039 qt_sip_flags,
00040 sip_file
00041 ]))
00042
00043
00044
00045
00046 makefile = pyqtconfig.QtGuiModuleMakefile(
00047 dir=build_dir,
00048 configuration=config,
00049 build_file=build_file
00050 )
00051
00052
00053 makefile.CXXFLAGS.append('-DTIXML_USE_STL')
00054
00055
00056 cmd = ['rospack', 'cflags-only-I', '--deps-only', 'rviz']
00057 po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
00058 out,err = po.communicate()
00059 outlist = [x for x in out.strip().split() if x]
00060 makefile.extra_include_dirs.extend(outlist)
00061
00062 cmd = ['rospack', 'libs-only-L', '--deps-only', 'rviz']
00063 po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
00064 out,err = po.communicate()
00065 outlist = [x for x in out.strip().split() if x]
00066 makefile.extra_lib_dirs.extend(outlist)
00067
00068 cmd = ['rospack', 'libs-only-l', '--deps-only', 'rviz']
00069 po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
00070 out,err = po.communicate()
00071 outlist = [x for x in out.strip().split() if x]
00072 makefile.extra_libs.extend(outlist)
00073
00074 cmd = ['rospack', 'libs-only-other', '--deps-only', 'rviz']
00075 po = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
00076 out,err = po.communicate()
00077 outlist = [x for x in out.strip().split() if x]
00078 makefile.LFLAGS.extend(outlist)
00079
00080
00081 rviz_package_path = roslib.packages.get_pkg_dir('rviz')
00082 makefile.extra_include_dirs.append(os.path.join(rviz_package_path, 'src'))
00083
00084
00085 makefile._target = os.path.join(output_dir, makefile._target)
00086
00087
00088 makefile.generate()