diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-11-22 21:01:13 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-11-22 21:01:13 (GMT) |
commit | bde4edb6ab6501de42bdc167e027a9f5c5760244 (patch) | |
tree | 0059ae69093206f7b94db2cdd6bbf0d2a64be54f /Tests | |
parent | 74ab0f6aa409a9d3e90c91b1b1c7a6e4b865ed62 (diff) | |
download | CMake-bde4edb6ab6501de42bdc167e027a9f5c5760244.zip CMake-bde4edb6ab6501de42bdc167e027a9f5c5760244.tar.gz CMake-bde4edb6ab6501de42bdc167e027a9f5c5760244.tar.bz2 |
automoc: add special handling for including basename_p.moc, with test
Alex
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/QtAutomoc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/QtAutomoc/main.cpp | 4 | ||||
-rw-r--r-- | Tests/QtAutomoc/yaf.cpp | 32 | ||||
-rw-r--r-- | Tests/QtAutomoc/yaf.h | 25 | ||||
-rw-r--r-- | Tests/QtAutomoc/yaf_p.h | 30 |
5 files changed, 92 insertions, 1 deletions
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index 9f02618..f47d5fd 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 abc.cpp xyz.cpp) +add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp) set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE) diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp index 7eb29a3..738f677 100644 --- a/Tests/QtAutomoc/main.cpp +++ b/Tests/QtAutomoc/main.cpp @@ -47,6 +47,7 @@ #include "sub/bar.h" #include "abc.h" #include "xyz.h" +#include "yaf.h" int main(int argv, char **args) { @@ -74,5 +75,8 @@ int main(int argv, char **args) Xyz xyz; xyz.doXyz(); + Yaf yaf; + yaf.doYaf(); + return app.exec(); } diff --git a/Tests/QtAutomoc/yaf.cpp b/Tests/QtAutomoc/yaf.cpp new file mode 100644 index 0000000..d278ab4 --- /dev/null +++ b/Tests/QtAutomoc/yaf.cpp @@ -0,0 +1,32 @@ +/*============================================================================ + 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 "yaf.h" +#include "yaf_p.h" + +#include <stdio.h> + +Yaf::Yaf() +{ +} + + +void Yaf::doYaf() +{ + YafP yafP; + yafP.doYafP(); +} + +// check that including a moc file from a private header the wrong way works: +#include "yaf_p.moc" diff --git a/Tests/QtAutomoc/yaf.h b/Tests/QtAutomoc/yaf.h new file mode 100644 index 0000000..8689f83 --- /dev/null +++ b/Tests/QtAutomoc/yaf.h @@ -0,0 +1,25 @@ +/*============================================================================ + 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 YAF_H +#define YAF_H + +class Yaf +{ + public: + Yaf(); + public: + void doYaf(); +}; + +#endif diff --git a/Tests/QtAutomoc/yaf_p.h b/Tests/QtAutomoc/yaf_p.h new file mode 100644 index 0000000..f0368ad --- /dev/null +++ b/Tests/QtAutomoc/yaf_p.h @@ -0,0 +1,30 @@ +/*============================================================================ + 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 YAF_P_H +#define YAF_P_H + +#include <QObject> + +#include <stdio.h> + +class YafP : public QObject +{ + Q_OBJECT + public: + YafP() {} + public slots: + void doYafP() { printf("I am yet another file !\n"); } +}; + +#endif |