On Tue, Mar 03, 2009 at 01:19:45PM +0000, Alban Rochel wrote:
> Dear all,
> 
> I am currently working on the delivery of various Qt-based drivers for 
> plplot, based on our own version of these drivers in our QSAS software.
> 
> Unfortunately, none of us in the team has knowledge in cmake, and 
> although I've managed to do most of what I wanted, I'm still stuck on 
> one point, and I would appreciate some help.
> 
> The Qt library somehow extends the C++ language by adding keywords in 
> the class declarations (in my case in qt.h). A qt.moc file has to be 
> generated from this file using the Qt moc software, converting the Qt 
> keywords to C++ implementations.
> 
> Thus, before compiling my qt.cpp implementation, I have to produce a 
> qt.moc file from qt.h. The QT4_GENERATE_MOC macro is supposed to do 
> that, but I haven't found exactly where to put this call.
> 
> I've added it in drivers-finish.cmake, as follows:
> elseif(DRIVER STREQUAL "qt")
>       FIND_PACKAGE(Qt4)
>       INCLUDE(${QT_USE_FILE})
>       QT4_GENERATE_MOC(qt.h qt.moc)
>          set(${DRIVER}_SOURCE
>       ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.cpp
>       ${${DRIVER}_SOURCE}
> But the qt.moc file is nowhere to be found. Maybe it should rather go 
> somewhere in drivers/CMakeLists.txt? Or cmake/modules/qt.cmake?
> 
> Any information would be welcome. Of course feel free to ask me for any 
> detail I would have omitted.

Alban,

I've not used the cmake qt support, but from what you have said I assume
that qt.h is an include file supplied by you for the qt driver. Is this in
the drivers directory? If so then I suspect your QT4_GENERATE_MOC command
wants to go in drivers/CMakeLists.txt. 

Generally the CMakeLists.txt command contains the instructions for building
the targets in that directory. In this case running moc on the header file
is part of the build processess, like compiling the source, so should go
there.

Files in the cmake/modules directory are cmake files which are used in
configuring plplot, testing for available compilers / headers / libraries 
etc. What you probably need is a new file in cmake/modules/ which checks for
the qt libraries and sets the cmake configuration variables accordingly. 
You can probably base it on one of the existing drivers. The code in
drivers/CMakeLists.txt will then actually do the building of the qt 
driver based on these configuration variables.

If you can get something which works, then Alan or I would be happy to tidy
it up into plplot "style" such as it is or help with the cmake support.

Thanks

Andrew

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to