Esempio n. 1
0
def generate_makefile(sip_config):
    sip_config.default_mod_dir = os.path.join(sip_config.default_mod_dir,
                                              'PyQt4')
    print('Install Module Dir: %s' % (sip_config.default_mod_dir))
    makefile = pyqtconfig.QtGuiModuleMakefile(sip_config,
                                              build_file(),
                                              dir=options.build_path)
    makefile.extra_include_dirs += [options.include_path]
    makefile.extra_lib_dirs += [options.lib_path]
    makefile.extra_libs += [options.lib]
    makefile.generate()
Esempio n. 2
0
def generate_code(mname):
    os.makedirs(mname)

    argv = [config.sip_bin, "-c", os.path.abspath(mname)]
    build_file = os.path.join(mname, mname + ".sbf")
    argv.extend(["-b", build_file])
    argv.extend(["-I", config.pyqt_sip_dir])
    argv.extend(["-I", os.path.join(src_dir, "sip")])
    argv.append(pyqt_sip_flags)
    sip_file = os.path.join(mname, mname + "mod.sip")
    argv.append(sip_file)

    cmd = " ".join(argv)
    print cmd
    os.system(cmd)

    installs = []
    if install_sips == True:
        sipfiles = []
        sipdir = os.path.join("sip", mname)
        if mname != "onyx":
            sipdir = os.path.join(src_dir, sipdir)
            rel_sipdir = sipdir
        else:
            rel_sipdir = os.path.join("..", sipdir)

        for s in glob.glob(os.path.join(sipdir, "*.sip")):
            sipfiles.append(os.path.join(rel_sipdir, os.path.basename(s)))

        installs.append([sipfiles, os.path.join(opts.pyqtsipdir, mname)])

    makefile = pyqtconfig.QtGuiModuleMakefile(configuration=config,
                                              build_file=mname + ".sbf",
                                              installs=installs,
                                              install_dir=pyonyx_modroot,
                                              dir=mname)
    if mname != "onyx":
        makefile.extra_libs = ["onyx_" + mname]
    makefile.generate()
Esempio n. 3
0
File: setup.py Progetto: cjh1/uvcdat
    # module's specification files using the -I flag.
    os.system(" ".join([ \
        config.sip_bin, \
        "-c", "cdatwrap", \
        "-b", build_file, \
        "-I", config.pyqt_sip_dir, \
        qt_sip_flags, \
        "cdat.sip" \
    ]))

    # Create the Makefile.  The QtModuleMakefile class provided by the
    # pyqtconfig module takes care of all the extra preprocessor, compiler and
    # linker flags needed by the Qt library.
    makefile = pyqtconfig.QtGuiModuleMakefile(
        dir="cdatwrap",
        configuration=config,
        build_file='../' + build_file
    )

    # Add the library we are wrapping.  The name doesn't include any platform
    # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
    # ".dll" extension on Windows).
    #makefile.extra_libs = ["vcs"]
    import cdat_info
    makefile.CFLAGS.append("-I%s/include" % cdat_info.externals)
    makefile.CFLAGS.append("-I%s" % vcs_inc)
    makefile.CFLAGS.append("-I%s/.." % sysconfig.get_python_inc())

    makefile.CXXFLAGS.append("-I%s/include" % cdat_info.externals)
    makefile.CXXFLAGS.append("-I%s" % vcs_inc)
    makefile.CXXFLAGS.append("-I%s/.." % sysconfig.get_python_inc())
Esempio n. 4
0
# We are going to install the SIP specification file for this module and
# its configuration module.
installs = []

installs.append(
    ["pyossim.sip",
     os.path.join(config.default_sip_dir, "pyossim")])

installs.append(["config.py", config.default_mod_dir])

# Create the Makefile.  The QtGuiModuleMakefile class provided by the
# pyqtconfig module takes care of all the extra preprocessor, compiler and
# linker flags needed by the Qt library.
makefile = pyqtconfig.QtGuiModuleMakefile(configuration=config,
                                          build_file=build_file,
                                          installs=installs)

# Add the library we are wrapping.  The name doesn't include any platform
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
# ".dll" extension on Windows).
makefile.extra_libs = ["ossim", "ossimPlanetQt"]

makefile.extra_lib_dirs = [
    "usr/local/include",
    "/home/vipul/ossim-svn/src/ossim_package_support/cmake/build",
    "/home/vipul/ossim-svn/src/ossimPlanetQt/include"
]

makefile.extra_include_dirs = [
    "/usr/local/include", "/home/vipul/ossim-svn/src/ossimPlanetQt/include",
Esempio n. 5
0
# The name of the SIP build file generated by SIP and used by the build
# system.
build_file = "QWave4.sbf"

# Get the SIP configuration information.
config = pyqtconfig.Configuration()

# Run SIP to generate the code.
cmdline = " ".join([
    config.sip_bin, "-c", "../python", "-b", build_file, "-w", "-I",
    config.pyqt_sip_dir, "-I", ".", config.pyqt_sip_flags, "main.sip"
])

os.system(cmdline)
print(cmdline)

# Create the Makefile.
makefile = pyqtconfig.QtGuiModuleMakefile(config,
                                          build_file,
                                          makefile="../python/Makefile")

# Add the library we are wrapping.  The name doesn't include any platform
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
# ".dll" extension on Windows).
makefile.extra_include_dirs = ["../src"]
makefile.extra_lib_dirs = ["../src/"]
makefile.extra_libs = ["qwave4"]

# Generate the Makefile itself.
makefile.generate()
Esempio n. 6
0
if not os.path.exists(output_dir):
    os.mkdir(output_dir)

# Build the pictureflow library.
os.system("cd lib; qmake; make")

# Run SIP to generate the code.
command = " ".join([
    config.sip_bin, "-c", output_dir, "-b",
    os.path.join(output_dir, build_file), "-I" + config.pyqt_sip_dir,
    "-I" + config.qt_inc_dir, config.pyqt_sip_flags,
    os.path.join(sip_files_dir, "pictureflowmod.sip")
])

print command
os.system(command)

# Create the Makefile.
makefile = pyqtconfig.QtGuiModuleMakefile(config, build_file, dir=output_dir)
makefile.extra_include_dirs.append(os.path.abspath(os.pardir))
makefile.extra_lib_dirs.append(os.path.abspath(os.curdir))
makefile.extra_lib_dirs.append(os.path.abspath("lib"))
makefile.extra_libs.append("pictureflow")

# Generate the Makefile itself.
config.pyqt_modules = config.pyqt_modules.split()
makefile.generate()
del config.pyqt_modules

sipconfig.ParentMakefile(configuration=config, subdirs=[output_dir]).generate()
os.system(' '.join([
  config.sip_bin,
  '-c', build_dir,
  '-b', os.path.join(build_dir, build_file),
  '-I', config.pyqt_sip_dir,
  '-w',
  qt_sip_flags,
  sip_file
]))

# Create the Makefile.  The QtModuleMakefile class provided by the
# pyqtconfig module takes care of all the extra preprocessor, compiler and
# linker flags needed by the Qt library.
makefile = pyqtconfig.QtGuiModuleMakefile(
  dir=build_dir,
  configuration=config,
  build_file=build_file
)

for include_dir in include_dirs.split(' '):
    makefile.extra_include_dirs.append(include_dir)
for lib in libs.split(' '):
    makefile.extra_libs.append(lib)
for lib_dir in lib_dirs.split(' '):
    makefile.extra_lib_dirs.append(lib_dir)
for ldflag in ldflags.split('\\ '):
    makefile.LFLAGS.append(ldflag)

# redirect location of generated library
makefile._target = os.path.join(output_dir, makefile._target)
Esempio n. 8
0
    # Run SIP to generate the code.  Note that we tell SIP where to find the qt
    # module's specification files using the -I flag.
    os.system(" ".join([ \
        config.sip_bin, \
        "-c", cdatwrap_dir_path, \
        "-b", build_file_path, \
        "-I", config.pyqt_sip_dir, \
        qt_sip_flags, \
        "cdat.sip" \
    ]))

    # Create the Makefile.  The QtModuleMakefile class provided by the
    # pyqtconfig module takes care of all the extra preprocessor, compiler and
    # linker flags needed by the Qt library.
    makefile = pyqtconfig.QtGuiModuleMakefile(dir=cdatwrap_dir_path,
                                              configuration=config,
                                              build_file=build_file)

    # Add the library we are wrapping.  The name doesn't include any platform
    # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
    # ".dll" extension on Windows).
    #makefile.extra_libs = ["vcs"]
    import cdat_info
    makefile.CFLAGS.append("-I%s/include" % cdat_info.externals)
    makefile.CFLAGS.append("-I%s" % vcs_inc)
    makefile.CFLAGS.append("-I%s/.." % sysconfig.get_python_inc())

    makefile.CXXFLAGS.append("-I%s/include" % cdat_info.externals)
    makefile.CXXFLAGS.append("-I%s" % vcs_inc)
    makefile.CXXFLAGS.append("-I%s/.." % sysconfig.get_python_inc())