AW: [CMake] Problem running moc, Qt.

Alexander Neundorf a.neundorf-work at gmx.net
Wed Jan 31 13:07:49 EST 2007


Von: "Gerhard Grimm" <ggrimm at detec.de>

> Hi Christian!
> 
> Why not try this:
> 
> 
> SET(cqtlib_MOC_HDRS 
> 	Test.h
> )
> 
> QT4_WRAP_CPP(cqtlib_MOC_SRC ${cqtlib_MOC_HDRS})
> 
> SET(cqtlib_SRCS
> 	${cqtlib_MOC_SRC}
> 	Test.cpp
> )
> 
> ADD_EXECUTABLE(Segmentation ${cqtlib_SRCS})
> 
> 
> Note that in this case, Test.cpp should NOT #include the source file
> created by moc, but the original header (Test.h).

Yes, this should work.
The point is to add the generated moc files (which are put into cqtlib_MOC_SRC) as source file to ADD_EXECUTABLE().
cmake needs this to get the correct dependencies.

Bye
Alex

-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail


More information about the CMake mailing list