[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2025-ga48aed9

Stephen Kelly steveire at gmail.com
Fri Feb 8 06:54:08 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a48aed9f06e0c99f393f37e1d929e69853fc95ce (commit)
       via  4afcc72173f81470d5496df661d06b67509fe29a (commit)
      from  623f04a71ceb2687b2b2b7cb961f45a848902a3e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a48aed9f06e0c99f393f37e1d929e69853fc95ce
commit a48aed9f06e0c99f393f37e1d929e69853fc95ce
Merge: 623f04a 4afcc72
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Feb 8 06:54:06 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 8 06:54:06 2013 -0500

    Merge topic 'minor-fixes' into next
    
    4afcc72 Add test for automoc target includes dependencies.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4afcc72173f81470d5496df661d06b67509fe29a
commit 4afcc72173f81470d5496df661d06b67509fe29a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Feb 7 19:35:00 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Feb 8 12:53:19 2013 +0100

    Add test for automoc target includes dependencies.

diff --git a/Tests/QtAutomoc/Adir/CMakeLists.txt b/Tests/QtAutomoc/Adir/CMakeLists.txt
new file mode 100644
index 0000000..abd328e
--- /dev/null
+++ b/Tests/QtAutomoc/Adir/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+
+add_library(libA SHARED libA.cpp)
+target_link_libraries(libA LINK_PUBLIC Qt4::QtCore)
+generate_export_header(libA)
diff --git a/Tests/QtAutomoc/Adir/libA.cpp b/Tests/QtAutomoc/Adir/libA.cpp
new file mode 100644
index 0000000..3968c44
--- /dev/null
+++ b/Tests/QtAutomoc/Adir/libA.cpp
@@ -0,0 +1,13 @@
+
+#include "libA.h"
+
+LibA::LibA(QObject *parent)
+  : QObject(parent)
+{
+
+}
+
+int LibA::foo()
+{
+  return 0;
+}
diff --git a/Tests/QtAutomoc/Adir/libA.h b/Tests/QtAutomoc/Adir/libA.h
new file mode 100644
index 0000000..03ad1e0
--- /dev/null
+++ b/Tests/QtAutomoc/Adir/libA.h
@@ -0,0 +1,18 @@
+
+#ifndef LIBA_H
+#define LIBA_H
+
+#include "liba_export.h"
+
+#include <QObject>
+
+class LIBA_EXPORT LibA : public QObject
+{
+  Q_OBJECT
+public:
+  explicit LibA(QObject *parent = 0);
+
+  int foo();
+};
+
+#endif
diff --git a/Tests/QtAutomoc/Bdir/CMakeLists.txt b/Tests/QtAutomoc/Bdir/CMakeLists.txt
new file mode 100644
index 0000000..5497105
--- /dev/null
+++ b/Tests/QtAutomoc/Bdir/CMakeLists.txt
@@ -0,0 +1,10 @@
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_BUILD_INTERFACE_INCLUDES ON)
+
+add_library(libB SHARED libB.cpp)
+generate_export_header(libB)
+
+# set_property(TARGET libB APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
+target_link_libraries(libB LINK_PUBLIC libA)
diff --git a/Tests/QtAutomoc/Bdir/libB.cpp b/Tests/QtAutomoc/Bdir/libB.cpp
new file mode 100644
index 0000000..72f2cfa
--- /dev/null
+++ b/Tests/QtAutomoc/Bdir/libB.cpp
@@ -0,0 +1,13 @@
+
+#include "libB.h"
+
+LibB::LibB(QObject *parent)
+  : QObject(parent)
+{
+
+}
+
+int LibB::foo()
+{
+  return a.foo();
+}
diff --git a/Tests/QtAutomoc/Bdir/libB.h b/Tests/QtAutomoc/Bdir/libB.h
new file mode 100644
index 0000000..510c17f
--- /dev/null
+++ b/Tests/QtAutomoc/Bdir/libB.h
@@ -0,0 +1,21 @@
+
+#ifndef LIBB_H
+#define LIBB_H
+
+#include "libb_export.h"
+
+#include <QObject>
+#include "libA.h"
+
+class LIBB_EXPORT LibB : public QObject
+{
+  Q_OBJECT
+public:
+  explicit LibB(QObject *parent = 0);
+
+  int foo();
+private:
+  LibA a;
+};
+
+#endif
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index 855fcf0..530818e 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -23,4 +23,18 @@ add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
 
 set_target_properties(foo codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
 
-target_link_libraries(foo codeeditorLib ${QT_LIBRARIES} )
+include(GenerateExportHeader)
+# The order is relevant here. B depends on A, and B headers depend on A
+# headers both subdirectories use CMAKE_BUILD_INTERFACE_INCLUDES and we
+# test that CMAKE_AUTOMOC successfully reads the include directories
+# for the build interface from those targets. There has previously been
+# a bug where caching of the include directories happened before
+# extracting the includes to pass to moc.
+add_subdirectory(Bdir)
+add_subdirectory(Adir)
+add_library(libC SHARED libC.cpp)
+set_target_properties(libC PROPERTIES AUTOMOC TRUE)
+generate_export_header(libC)
+target_link_libraries(libC LINK_PUBLIC libB)
+
+target_link_libraries(foo codeeditorLib ${QT_LIBRARIES} libC)
diff --git a/Tests/QtAutomoc/libC.cpp b/Tests/QtAutomoc/libC.cpp
new file mode 100644
index 0000000..8d61cb1
--- /dev/null
+++ b/Tests/QtAutomoc/libC.cpp
@@ -0,0 +1,13 @@
+
+#include "libC.h"
+
+LibC::LibC(QObject *parent)
+  : QObject(parent)
+{
+
+}
+
+int LibC::foo()
+{
+  return b.foo();
+}
diff --git a/Tests/QtAutomoc/libC.h b/Tests/QtAutomoc/libC.h
new file mode 100644
index 0000000..4fb4a2c
--- /dev/null
+++ b/Tests/QtAutomoc/libC.h
@@ -0,0 +1,22 @@
+
+#ifndef LIBC_H
+#define LIBC_H
+
+#include "libc_export.h"
+
+#include <QObject>
+#include "libB.h"
+
+class LIBC_EXPORT LibC : public QObject
+{
+  Q_OBJECT
+public:
+  explicit LibC(QObject *parent = 0);
+
+
+  int foo();
+private:
+  LibB b;
+};
+
+#endif
diff --git a/Tests/QtAutomoc/main.cpp b/Tests/QtAutomoc/main.cpp
index 738f677..d952171 100644
--- a/Tests/QtAutomoc/main.cpp
+++ b/Tests/QtAutomoc/main.cpp
@@ -48,6 +48,7 @@
 #include "abc.h"
 #include "xyz.h"
 #include "yaf.h"
+#include "libC.h"
 
 int main(int argv, char **args)
 {
@@ -78,5 +79,8 @@ int main(int argv, char **args)
   Yaf yaf;
   yaf.doYaf();
 
+  LibC lc;
+  lc.foo();
+
   return app.exec();
 }

-----------------------------------------------------------------------

Summary of changes:
 Tests/QtAutomoc/Adir/CMakeLists.txt |    8 ++++++++
 Tests/QtAutomoc/Adir/libA.cpp       |   13 +++++++++++++
 Tests/QtAutomoc/Adir/libA.h         |   18 ++++++++++++++++++
 Tests/QtAutomoc/Bdir/CMakeLists.txt |   10 ++++++++++
 Tests/QtAutomoc/Bdir/libB.cpp       |   13 +++++++++++++
 Tests/QtAutomoc/Bdir/libB.h         |   21 +++++++++++++++++++++
 Tests/QtAutomoc/CMakeLists.txt      |   16 +++++++++++++++-
 Tests/QtAutomoc/libC.cpp            |   13 +++++++++++++
 Tests/QtAutomoc/libC.h              |   22 ++++++++++++++++++++++
 Tests/QtAutomoc/main.cpp            |    4 ++++
 10 files changed, 137 insertions(+), 1 deletions(-)
 create mode 100644 Tests/QtAutomoc/Adir/CMakeLists.txt
 create mode 100644 Tests/QtAutomoc/Adir/libA.cpp
 create mode 100644 Tests/QtAutomoc/Adir/libA.h
 create mode 100644 Tests/QtAutomoc/Bdir/CMakeLists.txt
 create mode 100644 Tests/QtAutomoc/Bdir/libB.cpp
 create mode 100644 Tests/QtAutomoc/Bdir/libB.h
 create mode 100644 Tests/QtAutomoc/libC.cpp
 create mode 100644 Tests/QtAutomoc/libC.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list