On 2014-07-06 22:21-0400 Hazen Babcock wrote: > > Hello, > > I've just committed (r13136) an initial attempt at creating smoke > bindings for the qtwidget and extqt drivers. > > A description of smoke: > https://techbase.kde.org/Development/Languages/Smoke > > Basically smoke makes it easy (or at least easier) to write binding for > Qt and KDE from scripting languages, or from Lisp, which was why I was > interested. In our case these binding make it easier to integrate the Qt > drivers into an existing Qt application that is being developed in > languages such as Perl, Ruby, C# or Lisp. > > However, it does not quite work yet and I would appreciate it if someone > who is more knowledgeable about cmake could take a look at > bindings/qt_gui/smoke/CMakeLists.txt and suggest what I might be doing > wrong. Basically what happens is that the program smokegen parses the > qt.h file to decide how to create the smoke bindings .cpp files. These > are then linked to create the smoke bindings library, libsmokeplplotqt. > The problem that I'm having is that it seems to think that it should use > float for PLFLT instead of double at the generation stage, but then the > compiler errors out at the linking stage because it doesn't know how to > convert float* to double*. If I create the smoke bindings by hand > against the installed PLplot library as described here: > > https://github.com/HazenBabcock/cl-plplot/blob/master/commonqt-plot/README.txt > > then everything seems to work fine. My guess is that is because in the > installed version the question of whether PLFLT will be a float or a > double has already been resolved.
Hi Hazen: Interesting work which sounds like it will be most useful for us. >From your description above, smokegen parses qt.h. But that file #includes other headers which eventually #define PLFLT so that smokegen can properly interpret that macro (which is used directly in qt.h). How is smokegen finding those additional headers? That is determined by add_custom_command( OUTPUT ${plplot_smoke_SRC} COMMAND ${SMOKE_GEN_BIN} ARGS -config "${SMOKE_GEN_SHARED}/qt-config.xml" -smokeconfig "${CMAKE_CURRENT_SOURCE_DIR}/smokeconfig.xml" -I "${CMAKE_SOURCE_DIR}/include" -- ${CMAKE_CURRENT_SOURCE_DIR}/plplotqt.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/smokeconfig.xml ${CMAKE_CURRENT_SOURCE_DIR}/plplotqt.h ) Note, you should drop the ARGS keyword in that CMake command which is ignored/deprecated in CMake. But more importantly, I don't think that -I option is sufficient. Once, smokegen has done its stuff, then those generated *.cpp files are processed using the following include directories: ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/qsastime ${CMAKE_SOURCE_DIR}/lib/nistcd ${CMAKE_SOURCE_DIR}/drivers ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include Shouldn't the -I option(s) on the smokegen command include all of those directories as well? I hope that fix solves the PLFLT issue you have described, but I don't have time to try that for myself so let me know how it goes. By the way, once you get this all to work, could you also change qt.h to something more specific like plplot_qt.h? That qt.h name is much too simple and therefore obviously a nameclash waiting to happen. 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); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); 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 __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel