Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sip wrapper interface to use only relevant methods #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:

.qmake.stash
Makefile
PyQGLViewer.api
PyQGLViewer.pro
build
src/sip/QGLViewerModuleConfig.sip

######################################################################
### .gitignore ends here
29 changes: 14 additions & 15 deletions configureQt5.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#! /usr/bin/env python

# Copyright (c) 2016, Riverbank Computing Limited
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand All @@ -25,19 +27,16 @@

# This is v2.0 of this boilerplate.


from distutils import sysconfig
import glob
import os
import optparse
import sys


###############################################################################
# You shouldn't need to modify anything above this line.
###############################################################################


class PyQGLViewerConfiguration(object):
""" This class encapsulates the module specific information. """

Expand Down Expand Up @@ -318,7 +317,7 @@ def apply_options(target_configuration, options):
else:
libname = 'lib'+libname+'.dylib'
else:
libname = 'lib'+libname+'.so'
libname = 'lib'+libname+'.so'

defaultdir = [ qglviewer_includes, pj(qglviewer_includes, "QGLViewer"), pj(qglviewer_includes,os.path.pardir,'lib'),pj('/','usr','lib'),pj('/','usr','local','lib'),pj('/','opt','local','lib')]
for ddir in defaultdir:
Expand All @@ -328,7 +327,7 @@ def apply_options(target_configuration, options):
break

target_configuration.qglviewer_libpath = qglviewer_libpath

if options.qglviewer_includes:
print ("Found libQGLViewer-%s in '%s'." % (target_configuration.qglviewer_version_str, qglviewer_includes))
else:
Expand Down Expand Up @@ -1139,7 +1138,7 @@ def _create_optparser(target_config, pkg_config):
if _has_stubs(pkg_config):
p.add_option('--stubsdir', dest='stubsdir', type='string',
default=None, action='callback',
callback=optparser_store_abspath, metavar="DIR",
callback=optparser_store_abspath, metavar="DIR",
help="the PEP 484 stubs will be installed in DIR [default: "
"with the module]")
p.add_option('--no-stubs', dest='no_stubs', default=False,
Expand All @@ -1150,7 +1149,7 @@ def _create_optparser(target_config, pkg_config):
if pkg_config.qscintilla_api_file:
p.add_option('--apidir', '-a', dest='apidir', type='string',
default=None, action='callback',
callback=optparser_store_abspath, metavar="DIR",
callback=optparser_store_abspath, metavar="DIR",
help="the QScintilla API file will be installed in DIR "
"[default: QT_INSTALL_DATA/qsci]")
p.add_option('--no-qsci-api', dest='no_qsci_api', default=False,
Expand Down Expand Up @@ -1227,7 +1226,7 @@ def _create_optparser(target_config, pkg_config):
"[default: %s]" % target_config.pyqt_sip_dir)

p.add_option('--concatenate', '-c', dest='concat', default=False,
action='store_true',
action='store_true',
help="concatenate the C++ source files")
p.add_option('--concatenate-split', '-j', dest='split', type='int',
default=1, metavar="N",
Expand Down Expand Up @@ -1527,11 +1526,11 @@ def _generate_pro(target_config, opts, module_config):
else:
entry_point = 'init%s' % mname

exp = open('%s.exp' % mname, 'wt')
exp.write('{ global: %s; local: *; };' % entry_point)
exp.close()
# exp = open('%s.exp' % mname, 'wt')
# exp.write('{ global: %s; local: *; };' % entry_point)
# exp.close()

pro.write('QMAKE_LFLAGS += -Wl,--version-script=%s.exp\n' % mname)
# pro.write('QMAKE_LFLAGS += -Wl,--version-script=%s.exp\n' % mname)

if target_config.prot_is_public:
pro.write('DEFINES += SIP_PROTECTED_IS_PUBLIC protected=public\n')
Expand Down
77 changes: 42 additions & 35 deletions doc/INSTALL.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@

This project requires a recent version of SIP (tested with 4.17), Qt4, PyQt4 and libQGLViewer.

Note: PyQt4 should be installed with its sip and development files.

To build Python wrapper , you should simply do the following command
> python configure.py
You can specify the source repository of libQGLViewer with -Q option.
For instance
> python configure.py -Q ../libQGLViewer-2.2.6-3

Note: on windows you may have to specify the include and lib directories also, using absolute paths
> python configure.py -Q ../libQGLViewer-2.2.6-3 -I c:\path_to_libQGLViewer-2.2.6-3 -L c:\path_to_libQGLViewer-2.2.6-3\QGLViewer\release

Then you simply have to compile and install with
> make (or nmake)
> make install (or nmake install, you should be root)

You can then test the new module with all examples
that you can find in the directory PyQGLViewer/examples.

Good luck,

Fred


------------
News:
The setup.py file has been updated to allow you to compile the project.
For this,
python setup.py build # to compile
python setup.py install # to install on your system
python setup.py bdist # to create a binary distribution


This project requires a recent version of SIP (tested with 4.17), Qt4, PyQt4 and libQGLViewer.

Note: PyQt4 should be installed with its sip and development files.

To build Python wrapper , you should simply do the following command
> python configure.py
You can specify the source repository of libQGLViewer with -Q option.
For instance
> python configure.py -Q ../libQGLViewer-2.2.6-3

Note: on windows you may have to specify the include and lib directories also, using absolute paths
> python configure.py -Q ../libQGLViewer-2.2.6-3 -I c:\path_to_libQGLViewer-2.2.6-3 -L c:\path_to_libQGLViewer-2.2.6-3\QGLViewer\release

Then you simply have to compile and install with
> make (or nmake)
> make install (or nmake install, you should be root)

You can then test the new module with all examples
that you can find in the directory PyQGLViewer/examples.

Good luck,

Fred


------------
News:
The setup.py file has been updated to allow you to compile the project.
For this,
python setup.py build # to compile
python setup.py install # to install on your system
python setup.py bdist # to create a binary distribution


------------
News:
The configureQt5.py file has been updated to allow you to compile the project.
For this,
chmod u+x configureQt5.py
./configureQt5.py --qglviewer-sources=/path/to/qglviewer/ --qglviewer-libpath=/path/to/qglviewer/ --qglviewer-libs=QGLViewer --sip-incdir=/usr/local/include/ # --qglviewer-libs=QGLViewer-qt5 on Linux
make
sudo make install
7 changes: 4 additions & 3 deletions src/sip/QGLViewerModule.sip
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
%Import QtOpenGL/QtOpenGLmod.sip
%Import QtXml/QtXmlmod.sip

%Timeline {QGLViewer_2_2_3 QGLViewer_2_2_4 QGLViewer_2_2_5 QGLViewer_2_2_6
QGLViewer_2_3_0 QGLViewer_2_3_1 QGLViewer_2_3_2 QGLViewer_2_3_3 QGLViewer_2_3_4 QGLViewer_2_3_5
%Timeline {QGLViewer_2_2_3 QGLViewer_2_2_4 QGLViewer_2_2_5 QGLViewer_2_2_6
QGLViewer_2_3_0 QGLViewer_2_3_1 QGLViewer_2_3_2 QGLViewer_2_3_3 QGLViewer_2_3_4 QGLViewer_2_3_5
QGLViewer_2_3_6 QGLViewer_2_3_7 QGLViewer_2_3_8 QGLViewer_2_3_9
QGLViewer_2_3_10 QGLViewer_2_3_11 QGLViewer_2_3_12 QGLViewer_2_3_13
QGLViewer_2_3_14 QGLViewer_2_3_15 QGLViewer_2_3_16 QGLViewer_2_3_17
QGLViewer_2_4_0 QGLViewer_2_4_1 QGLViewer_2_5_0 QGLViewer_2_5_1 QGLViewer_2_5_2 QGLViewer_2_5_3 QGLViewer_2_5_4
QGLViewer_2_6_0 QGLViewer_2_6_1 QGLViewer_2_6_2 QGLViewer_2_6_3 QGLViewer_2_6_4}
QGLViewer_2_6_0 QGLViewer_2_6_1 QGLViewer_2_6_2 QGLViewer_2_6_3 QGLViewer_2_6_4
QGLViewer_2_7_0}
%Feature FRIEND_EQUAL_SUPPORT

%Copying
Expand Down
Loading