diff options
author | Matthias Kretz <kretz@kde.org> | 2007-07-12 08:15:33 +0000 |
---|---|---|
committer | Matthias Kretz <kretz@kde.org> | 2007-07-12 08:15:33 +0000 |
commit | ffdfd12a80c61d5b5a4abf96de76e5e1702fb619 (patch) | |
tree | 54c987b1f78f6b1469b6b15adaf4501c90b3926b | |
parent | dbd9ded5439638a7d5599268acc6aa9e8f34f664 (diff) | |
download | extra-cmake-modules-ffdfd12a80c61d5b5a4abf96de76e5e1702fb619.tar.gz extra-cmake-modules-ffdfd12a80c61d5b5a4abf96de76e5e1702fb619.tar.bz2 |
Use configure_file instead of file(write ...) so that the file is only touched
when it really changes. Now the automoc target may depend on that file and
doesn't have to depend on CMakeLists.txt anymore.
svn path=/trunk/KDE/kdelibs/; revision=686821
-rw-r--r-- | modules/KDE4Macros.cmake | 5 | ||||
-rw-r--r-- | modules/kde4automoc.files.in | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 606f8a9e..5613c8d6 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -203,6 +203,7 @@ macro(KDE4_HANDLE_AUTOMOC _target_NAME _SRCS) get_source_file_property(_skip "${_abs_current_FILE}" SKIP_AUTOMOC) get_source_file_property(_generated "${_abs_current_FILE}" GENERATED) + # TODO: skip every source file that's not C++ if(NOT _generated AND NOT _skip) get_filename_component(_basename "${_current_FILE}" NAME_WE) get_filename_component(_abs_path "${_abs_current_FILE}" PATH) @@ -216,14 +217,14 @@ macro(KDE4_HANDLE_AUTOMOC _target_NAME _SRCS) set(_automoc_source "${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_automoc.cpp") GET_DIRECTORY_PROPERTY(_moc_incs INCLUDE_DIRECTORIES) - FILE(WRITE ${_automoc_source}.files "MOC_INCLUDES:\n${_moc_incs}\nSOURCES:\n${_moc_files}") + CONFIGURE_FILE(${KDE4_MODULE_DIR}/kde4automoc.files.in ${_automoc_source}.files) add_custom_command(OUTPUT ${_automoc_source} COMMAND ${KDE4_AUTOMOC_EXECUTABLE} ${_automoc_source} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_MOC_EXECUTABLE} - DEPENDS ${${_SRCS}} ${_moc_headers} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${_KDE4_AUTOMOC_EXECUTABLE_DEP} + DEPENDS ${${_SRCS}} ${_moc_headers} ${_automoc_source}.files ${_KDE4_AUTOMOC_EXECUTABLE_DEP} ) # the OBJECT_DEPENDS is only necessary when a new moc file has to be generated that is included in a source file # problem: the whole target is recompiled when the automoc.cpp file is touched diff --git a/modules/kde4automoc.files.in b/modules/kde4automoc.files.in new file mode 100644 index 00000000..011c52a3 --- /dev/null +++ b/modules/kde4automoc.files.in @@ -0,0 +1,4 @@ +MOC_INCLUDES: +@_moc_incs@ +SOURCES: +@_moc_files@ |