[CMake] re-moc not occurring

Craig Bradney cbradney at zip.com.au
Thu Jun 8 15:40:11 EDT 2006


On Wednesday 07 June 2006 23:48, Alexander Neundorf wrote:
> > -------- Original-Nachricht --------
> > Datum: Wed, 7 Jun 2006 23:02:41 +0200
> > Von: Craig Bradney <cbradney at zip.com.au>
> > An: Alexander Neundorf <a.neundorf-work at gmx.net>
> > Betreff: Re: [CMake] re-moc not occurring
>> >
> > On Wednesday 07 June 2006 22:51, Alexander Neundorf wrote:
> > > > -------- Original-Nachricht --------
> > > > Datum: Wed, 7 Jun 2006 22:50:21 +0200
> > > > Von: Craig Bradney <cbradney at zip.com.au>
> > > > An: cmake at www.cmake.org
> > > > Betreff: [CMake] re-moc not occurring
> > > > 
> > > > Hi,
> > > >
> > > > I'm wondering if theres been any known issues with regards to moc not
> > > > being
> > > > rerun after changes to the .h/.cpp files? We seem to hit this a lot
> >
> > with
> >
> > > > Scribus. There might be a slight chance it happens more often when
> > > > building
> > > > out of source. Any ideas? What further info shall I give?
> > >
> > > How do you generate the moc rules ?
> > > QT4_WRAP_CPP(), QT4_AUTOMOC() or QT4_GENERATE_MOC() ?
> >
> > Scribus is Qt3.. so..
> >
> > IF(QT_WRAP_CPP)
> >   SCRIBUS_QT_WRAP_CPP(scribus ${SCRIBUS_MOC_CLASSES})
> > ENDIF(QT_WRAP_CPP)
> >
> > Where SCRIBUS_MOC_CLASSES is a list of the header files requiring
> > moc'ing..
> > and the SCRIBUS_QT_WRAP_CPP is as follows, partly based on your previous
> > advice
> > (http://mail.kde.org/pipermail/kde-buildsystem/2006-March/002063.html)
> > ..
> >   MACRO(SCRIBUS_QT_WRAP_CPP outfiles )
> >
> >     # get include dirs
> >     FOREACH(it ${ARGN})
> >       GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
> >
> >       SET(infile ${CMAKE_CURRENT_SOURCE_DIR}/${it})
> >       SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}.moc)
> >       ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
> >         COMMAND ${QT_MOC_EXECUTABLE}
> >           ARGS -o ${outfile} ${infile}
> >         MAIN_DEPENDENCY ${infile})
> >       SET(${outfiles} ${${outfiles}} ${outfile})
> >     ENDFOREACH(it)
> >
> >   ENDMACRO(SCRIBUS_QT_WRAP_CPP)
>
> Try whether replacing MAIN_DEPENDENCY with DEPENDS has an effect. They
> behave slighty differently. Bill, didn't you want to add a note to the docs
> ?
>
> Instead of
> SET(infile ${CMAKE_CURRENT_SOURCE_DIR}/${it})
> you should use
> GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
> this will work both with absolute and relative paths.
>
> Other from that, it looks good.
> Which cmake version do you use/require ?
> I'd recommend 2.4.2.

Those suggestions don't seem to change anything. We require 2.4.1 though I'm 
running 2.4.2 normally (have a CVS tree too). 

Craig


More information about the CMake mailing list