diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index 9540e52e9..c81ac11d9 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -13,7 +13,7 @@ add_definitions(-DFOO) # create an executable and a library target, both requiring automoc: add_library(codeeditorLib STATIC codeeditor.cpp) -add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp) +add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp) set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE) diff --git a/Tests/QtAutomoc/abc.cpp b/Tests/QtAutomoc/abc.cpp new file mode 100644 index 000000000..f9226154e --- /dev/null +++ b/Tests/QtAutomoc/abc.cpp @@ -0,0 +1,41 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2004-2011 Kitware, Inc. + Copyright 2011 Alexander Neundorf (neundorf@kde.org) + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + + +#include "abc.h" + +#include + +class PrintAbc : public QObject +{ + Q_OBJECT + public: + PrintAbc():QObject() {} + public slots: + void print() const { printf("abc\n"); } +}; + +Abc::Abc() +:QObject() +{ +} + + +void Abc::doAbc() +{ + PrintAbc pa; + pa.print(); +} + +#include "abc.moc" +#include "moc_abc.cpp" diff --git a/Tests/QtAutomoc/abc.h b/Tests/QtAutomoc/abc.h new file mode 100644 index 000000000..d1924b0da --- /dev/null +++ b/Tests/QtAutomoc/abc.h @@ -0,0 +1,28 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2004-2011 Kitware, Inc. + Copyright 2011 Alexander Neundorf (neundorf@kde.org) + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef ABC_H +#define ABC_H + +#include + +class Abc : public QObject +{ + Q_OBJECT + public: + Abc(); + public slots: + void doAbc(); +}; + +#endif diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp index 58e2a191a..5414dafaa 100644 --- a/Tests/QtAutomoc/main.cpp +++ b/Tests/QtAutomoc/main.cpp @@ -45,6 +45,7 @@ #include "foo.h" #include "blub.h" #include "sub/bar.h" +#include "abc.h" int main(int argv, char **args) { @@ -66,5 +67,8 @@ int main(int argv, char **args) Bar bar; bar.doBar(); + Abc abc; + abc.doAbc(); + return app.exec(); }