summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutomoc
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-11-22 18:13:03 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-11-22 19:51:59 (GMT)
commit80dfbc99f4b04b5eaea9111fa014f07603a8db16 (patch)
tree86a17591d0c44505778394dea2251a1a23dcb74e /Tests/QtAutomoc
parent72bb058e92167a272b40b4b710fc2fe41b1fc8fe (diff)
downloadCMake-80dfbc99f4b04b5eaea9111fa014f07603a8db16.zip
CMake-80dfbc99f4b04b5eaea9111fa014f07603a8db16.tar.gz
CMake-80dfbc99f4b04b5eaea9111fa014f07603a8db16.tar.bz2
automoc: add a test for including both abc.moc and moc_abc.cpp
Alex
Diffstat (limited to 'Tests/QtAutomoc')
-rw-r--r--Tests/QtAutomoc/CMakeLists.txt2
-rw-r--r--Tests/QtAutomoc/abc.cpp41
-rw-r--r--Tests/QtAutomoc/abc.h28
-rw-r--r--Tests/QtAutomoc/main.cpp4
4 files changed, 74 insertions, 1 deletions
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index 9540e52..c81ac11 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 0000000..f922615
--- /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 <stdio.h>
+
+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 0000000..d1924b0
--- /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 <QObject>
+
+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 58e2a19..5414daf 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();
}