示例#1
0
def check_qscintilla():
    """See if QScintilla can be found and what its version is.
    """
    # Find the QScintilla header files.
    sciglobal = os.path.join(opts.qsciincdir, "Qsci", "qsciglobal.h")

    if os.access(sciglobal, os.F_OK):
        # Get the QScintilla version string.
        _, sciversstr = sipconfig.read_version(sciglobal, "QScintilla",
                                               "QSCINTILLA_VERSION",
                                               "QSCINTILLA_VERSION_STR")

        if glob.glob(os.path.join(opts.qscilibdir, "*qscintilla2*")):
            # Because we include the Python bindings with the C++ code we can
            # reasonably force the same version to be used and not bother about
            # versioning.
            if sciversstr != "2.10.8":
                sipconfig.error(
                    "QScintilla %s is being used but the Python bindings 2.10.8 are being built.  Please use matching versions."
                    % sciversstr)

            sipconfig.inform("QScintilla %s is being used." % sciversstr)
        else:
            sipconfig.error(
                "The QScintilla library could not be found in %s. If QScintilla is installed then use the -o argument to explicitly specify the correct directory."
                % opts.qscilibdir)
    else:
        sipconfig.error(
            "Qsci/qsciglobal.h could not be found in %s. If QScintilla is installed then use the -n argument to explicitly specify the correct directory."
            % opts.qsciincdir)
示例#2
0
def check_qglviewer(configuration, options):

    pj = os.path.join
    qglviewer_sources = options.qglviewer_sources
    if qglviewer_sources is None or not os.path.exists(qglviewer_sources):
        PREFIX = os.environ.get('PREFIX', os.environ.get('CONDA_PREFIX'))
        options.qglviewer_sources = None
        defaultdir = [pj(PREFIX,'include')]
        for ddir in defaultdir:
            if os.path.exists(pj(ddir, "QGLViewer")):
                qglviewer_sources = ddir
                break
        else: qglviewer_sources = defaultdir[0]
    qglviewer_config = os.path.join(qglviewer_sources, "QGLViewer", "config.h")

    QGLVIEWER_VERSION_STR = None
    if os.access(qglviewer_config, os.F_OK):
        # Get the qglviewer version string.
        QGLVIEWER_VERSION, QGLVIEWER_VERSION_STR = sipconfig.read_version(qglviewer_config, "QGLViewer", "QGLVIEWER_VERSION")
    else:
        raise Die, 'Cannot find libQGLViewer headers. Use option -Q for that.'

    if QGLVIEWER_VERSION_STR is None:
        QGLVIEWER_VERSION_STR = str((QGLVIEWER_VERSION & 0xff0000) >> 16)+'.'+str((QGLVIEWER_VERSION & 0x00ff00) >> 8)+'.'+str((QGLVIEWER_VERSION  & 0x0000ff))

    options.timelines.append('-t QGLViewer_'+QGLVIEWER_VERSION_STR.replace('.','_'))
    if options.qglviewer_sources:
        print ("Found libQGLViewer-%s in '%s'." % (QGLVIEWER_VERSION_STR, options.qglviewer_sources))
    else:
        print ('Found libQGLViewer-%s.' % QGLVIEWER_VERSION_STR)

    return options
示例#3
0
def check_qicstable():
    """See if QicsTable can be found and what its version is.
    """
    # Find the QicsTable header files.
    nspace = os.path.join(opt_qicstableincdir, "QicsNamespace.h")

    if os.access(nspace, os.F_OK):
        # Get the version number string.
        _, vstr = sipconfig.read_version(nspace, "QicsTable", None,
                                         "QICSTABLE_VERSION")

        # Extract the version number and hope that the format is consistent.
        try:
            vlist = string.split(vstr)
            maj, min, bug = string.split(vlist[1], ".")
            versnr = (int(maj) << 16) | (int(min) << 8) | int(bug)
            vstr = string.join(vlist[1:])
        except:
            raise ValueError, "Unable to extract version number from QICSTABLE_VERSION in QicsNamespace.h"

        if glob.glob(os.path.join(opt_qicstablelibdir, "*qicstable*")):
            global qicstable_version
            qicstable_version = versnr

            sipconfig.inform("QicsTable %s is being used." % vstr)
        else:
            sipconfig.inform(
                "The QicsTable library could not be found in %s and so the qicstable module will not be built. If QicsTable is installed then use the -o argument to explicitly specify the correct directory."
                % opt_qicstablelibdir)
    else:
        sipconfig.inform(
            "QicsNamespace.h could not be found in %s and so the qicstable module will not be built. If QicsTable is installed then use the -n argument to explicitly specify the correct directory."
            % opt_qicstableincdir)
示例#4
0
    def _gglviewer_version(self):
        """ Retrieve libQGLViewer version """
        if QGLViewerPath is None: 
            qglviewer_sources = pj('/','usr','include')
        else: qglviewer_sources = QGLViewerPath
        qglviewer_config = pj(qglviewer_sources, "QGLViewer", "config.h")

        if os.access(qglviewer_config, os.F_OK):
            # Get the qglviewer version string.
            QGLVIEWER_VERSION, QGLVIEWER_VERSION_STR = sipconfig.read_version(qglviewer_config, "QGLViewer", "QGLVIEWER_VERSION")
        else:
            raise Exception("Cannot access '"+qglviewer_config+"'")
    
        if QGLVIEWER_VERSION_STR is None:
            return str((QGLVIEWER_VERSION & 0xff0000) >> 16)+'.'+str((QGLVIEWER_VERSION & 0x00ff00) >> 8)+'.'+str((QGLVIEWER_VERSION  & 0x0000ff))
        return QGLVIEWER_VERSION_STR
示例#5
0
def check_qglviewer(configuration, options):
    pj = os.path.join
    qglviewer_sources = options.qglviewer_sources
    if qglviewer_sources is None or not os.path.exists(qglviewer_sources):
        options.qglviewer_sources = None
        defaultdir = [
            pj('/', 'usr', 'include'),
            pj('/', 'usr', 'local', 'include'),
            pj('/', 'opt', 'local', 'include')
        ]
        for ddir in defaultdir:
            if os.path.exists(pj(ddir, "QGLViewer")):
                qglviewer_sources = ddir
                break
        else:
            qglviewer_sources = defaultdir[0]
    qglviewer_config = os.path.join(qglviewer_sources, "QGLViewer", "config.h")

    QGLVIEWER_VERSION_STR = None
    if os.access(qglviewer_config, os.F_OK):
        # Get the qglviewer version string.
        QGLVIEWER_VERSION, QGLVIEWER_VERSION_STR = sipconfig.read_version(
            qglviewer_config, "QGLViewer", "QGLVIEWER_VERSION")
    else:
        raise Die, 'Cannot find libQGLViewer headers. Use option -Q for that.'

    if QGLVIEWER_VERSION_STR is None:
        QGLVIEWER_VERSION_STR = str(
            (QGLVIEWER_VERSION & 0xff0000) >> 16) + '.' + str(
                (QGLVIEWER_VERSION & 0x00ff00) >> 8) + '.' + str(
                    (QGLVIEWER_VERSION & 0x0000ff))

    options.timelines.append('-t QGLViewer_' +
                             QGLVIEWER_VERSION_STR.replace('.', '_'))
    if options.qglviewer_sources:
        print("Found libQGLViewer-%s in '%s'." %
              (QGLVIEWER_VERSION_STR, options.qglviewer_sources))
    else:
        print('Found libQGLViewer-%s.' % QGLVIEWER_VERSION_STR)

    return options
示例#6
0
def check_qscintilla():
    """See if QScintilla can be found and what its version is.
    """
    # Find the QScintilla header files.
    sciglobal = os.path.join(opts.qsciincdir, "Qsci", "qsciglobal.h")

    if os.access(sciglobal, os.F_OK):
        # Get the QScintilla version string.
        _, sciversstr = sipconfig.read_version(sciglobal, "QScintilla", "QSCINTILLA_VERSION", "QSCINTILLA_VERSION_STR")

        if glob.glob(os.path.join(opts.qscilibdir, "*qscintilla2*")):
            # Because we include the Python bindings with the C++ code we can
            # reasonably force the same version to be used and not bother about
            # versioning.
            if sciversstr != "2.9.1":
                sipconfig.error("QScintilla %s is being used but the Python bindings 2.9.1 are being built.  Please use matching versions." % sciversstr)

            sipconfig.inform("QScintilla %s is being used." % sciversstr)
        else:
            sipconfig.error("The QScintilla library could not be found in %s. If QScintilla is installed then use the -o argument to explicitly specify the correct directory." % opts.qscilibdir)
    else:
        sipconfig.error("Qsci/qsciglobal.h could not be found in %s. If QScintilla is installed then use the -n argument to explicitly specify the correct directory." % opts.qsciincdir)