On 2009-07-21 10:53+0100 Andrew Ross wrote:

> Alan - perhaps you can cast an eye over this [CMake method of dealing
with #includeing source code]? You may be able to think of
> a better way of doing it.

It might be a little cleaner in style to configure a file rather than
writing it.  That could be done with a template file with the line

@include_statement@

where in the CMake logic you have either

set(include_statement "#include\"${QT_MOC_OUTFILES}\"")

or

set(include_statement)

depending on whether moc is run or not.  That change in style still means
that the header is written at CMake time.

With regard to the more fundamental question of whether CMake handles the
dependencies right for a chain of #includes that goes through an unchanging
header (created at cmake time) to source code generated at make time (as in
this case), my feeling is it might work since CMake uses a C source code
parser to figure out #included dependencies. Is it possible to reinstate the
GENERATED property for the generated source code or were you forced to
comment it out?  In any case, I would go ahead and test dependencies using
touch on qt.h both with and without the GENERATED property (if possible) to
see experimentally whether CMake does the right thing here or not.

If there is no way you can make the dependencies work correctly with the
method you are using now (with or without the GENERATED property), then I
believe you could force CMake to do the right thing using the same method we
use for plhershey-unicode.h_built in include/CMakeLists.txt.

>
> This just leaves the issue of getting the right PLDLLIMPEXP macros into the
> sip generated code. I have added the infrastructure to define the
> PLDLLIMPEXP_PYQT4 macros. All that is required is to add this macro to the
> definition of initplplot_pyqt4 in sipplplot_pyqt4cmodule.cpp and everything
> works. I've done this by hand and checked that the pyqt4_example.py
> example works correctly. I know nothing about sip. Is it possible to do
> this automatically or do we need to massage the code after it has been
> generated?

I only know a slight bit about sip, but the specification files (such
as plplot_pyqt4.sip) are very similar to headers.  You will see in that
file

#include "qt.h"

which in turn generates

#include "qt.h"

in sipplplot_pyqt4cmodule.cpp.

I presume you could #include other headers as well in the sip specification
file and they would correspondingly be #included in
sipplplot_pyqt4cmodule.cpp.  Would it be possible to #define
initplplot_pyqt4 in a special header or even in qt.h so the
PLDLLIMPEXP_PYQT4 macro is effectively used?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to