summaryrefslogtreecommitdiffstats
path: root/Tests/Qt4And5Automoc/main.cpp.in
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-01-24 12:02:16 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-28 20:04:10 (GMT)
commit321e348e133f2f62dd51cd663fe30c7513ea53d8 (patch)
tree284062c935e209110b204d06b07ebeb07be9cecf /Tests/Qt4And5Automoc/main.cpp.in
parente96683b048e1d710b1bb0791b816638207283ef0 (diff)
downloadCMake-321e348e133f2f62dd51cd663fe30c7513ea53d8.zip
CMake-321e348e133f2f62dd51cd663fe30c7513ea53d8.tar.gz
CMake-321e348e133f2f62dd51cd663fe30c7513ea53d8.tar.bz2
QtAutogen: Use Qt 4 IMPORTED targets to find executable locations.
Avoid using the moc from Qt 5 with Qt 4 based targets. Moc generates a version check to ensure that such generated code does not compile. The Qt4And5Automoc unit test should have been testing this, but it was not because the test was broken. In that unit test, moc was run on trivial files which have no significant content, and in particular no Q_OBJECT macro. Therefore moc was generating empty files which do not even contain the version check. Fix this by generating files for input to moc at cmake time.
Diffstat (limited to 'Tests/Qt4And5Automoc/main.cpp.in')
-rw-r--r--Tests/Qt4And5Automoc/main.cpp.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/Qt4And5Automoc/main.cpp.in b/Tests/Qt4And5Automoc/main.cpp.in
new file mode 100644
index 0000000..00fd641
--- /dev/null
+++ b/Tests/Qt4And5Automoc/main.cpp.in
@@ -0,0 +1,18 @@
+
+#include <QObject>
+
+class SomeObject : public QObject
+{
+ Q_OBJECT
+public:
+ explicit SomeObject(QObject *parent = 0)
+ : QObject(parent)
+ {
+
+ }
+};
+
+int main(int argc, char **argv)
+{
+ return 0;
+}