From 6c4cc3653e8dd7668295f3e659b7eb4dc571b67c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 22 Nov 2011 02:59:34 -0600 Subject: Initial import of SIP4 for Qt3 --- doc/html/distutils.html | 141 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 doc/html/distutils.html (limited to 'doc/html/distutils.html') diff --git a/doc/html/distutils.html b/doc/html/distutils.html new file mode 100644 index 0000000..9531ffd --- /dev/null +++ b/doc/html/distutils.html @@ -0,0 +1,141 @@ + + + + + + + Building Your Extension with distutils — SIP 4.10.5 Reference Guide + + + + + + + + + + + + +
+
+
+
+ +
+

Building Your Extension with distutilsΒΆ

+

To build the example in A Simple C++ Example using distutils, it is +sufficient to create a standard setup.py, listing word.sip among the +files to build, and hook-up SIP into distutils:

+
from distutils.core import setup, Extension
+import sipdistutils
+
+setup(
+  name = 'word',
+  versione = '1.0',
+  ext_modules=[
+    Extension("word", ["word.sip", "word.cpp"]),
+    ],
+
+  cmdclass = {'build_ext': sipdistutils.build_ext}
+)
+
+
+

As we can see, the above is a normal distutils setup script, with just a +special line which is needed so that SIP can see and process word.sip. +Then, running setup.py build will build our extension module.

+

If you want to use any of sip’s command-line options described in +The SIP Command Line, there is a new option available for the +build_ext command in distutils: --sip-opts. So you can either invoke +distutils as follows:

+
$ python setup.py build_ext --sip-opts="-e -g" build
+
+

or you can leverage distutils’ config file support by creating a setup.cfg +file in the supported system or local paths (eg: in the same directory of +setup.py) with these contents:

+
[build_ext]
+sip-opts = -e -g
+
+
+

and then run setup.py build as usual.

+
+ + +
+
+
+
+
+

Previous topic

+

The Build System

+

Next topic

+

Builtin Modules and Custom Interpreters

+ + +
+
+
+
+ + + + \ No newline at end of file -- cgit v1.2.3