From c0980c740022e025fb6c089092f03992ac8a90ba Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Mon, 9 Jul 2007 15:27:27 +0000 Subject: As posted to kde-buildsystem: I replaced kde4automoc.cmake with a C++/QtCore based program that can run more efficient. Instead of creating a .automoc file that is added to the target I create a _automoc.cpp file now that is compiled and linked into the target. This file #includes all moc files that are not included by other source files. This way the automoc can, at make-time, decide what mocs need to be compiled explicitly and linked into the target. E.g. the following is possible now: foo.h: class A : public QObject { Q_OBJECT ... }; foo.cpp does not #include "foo.moc" run make - everything compiles and links fine (without mentioning the header in KDE4_MOC_HEADERS either since the new automoc looks at all corresponding header files from the .cpp files by itself) now change foo.cpp to #include "foo.moc" running make now will just work, even with the /fast target. Next change I did was to create a _automoc.cpp.files file to pass the moc includes and the source files that belong to the target to the automoc. I could have kept it on the command line but I got a report that the command line was already too long for Windows' cmd.exe. Implementation details: - The messages of the automoc are written using cmake -E cmake_echo_color, so the automoc correctly colorizes its messages now. - The moc QProcesses are started in parallel (up to 10). svn path=/trunk/KDE/kdelibs/; revision=685719 --- automoc/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 automoc/CMakeLists.txt (limited to 'automoc/CMakeLists.txt') diff --git a/automoc/CMakeLists.txt b/automoc/CMakeLists.txt new file mode 100644 index 00000000..553aa1af --- /dev/null +++ b/automoc/CMakeLists.txt @@ -0,0 +1,5 @@ +include_directories(${QT_INCLUDE_DIR}) +add_executable(kde4automoc kde4automoc.cpp) +kde4_handle_rpath_for_executable(kde4automoc "RUN_UNINSTALLED") +target_link_libraries(kde4automoc ${QT_QTCORE_LIBRARY}) +install(TARGETS kde4automoc DESTINATION ${BIN_INSTALL_DIR}) -- cgit v1.2.1