On 31.10.11 12:15:23, Laszlo Papp wrote:
> Hi,
> 
> I would like to achieve something like this by using cmake:
> http://doc.qt.nokia.com/4.8/activeqt-comapp.html
> 
> I would like to have a QObject subclass in my main.cpp file since it
> has just one method for instance, and thus it would be a convenient
> approach for me.

Three problems in your example:

a) for qt4_automoc (and presumambly the cmake-builtin moc-support) you
need to use the #include "moc_XXX..." form when the QObject class is in
a C++ implementation file. The #include "XXX.moc" version is for the
cases where the header contains the qobject class.

b) The FindQt4.cmake file developers decided to use .cxx as C++ file
extension, probably to avoid conflicts with existing files. So the above
needs to read #include "moc_XXX.cxx" for qt4_automoc to work

c) Your class declaration lacks the semicolon at its end.

With all those fixed the sample should compile.

Andreas

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to