diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-07-12 19:34:41 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-07-12 19:34:41 +0000 |
commit | fd3a1772eded684647d10ac39f4eb2ef14ec0d9c (patch) | |
tree | 6b35a0e19a97ea60be8b3f04e52727688526c778 /modules | |
parent | b797823de2557e12cebf464ce5c54095a30e8647 (diff) | |
download | extra-cmake-modules-fd3a1772eded684647d10ac39f4eb2ef14ec0d9c.tar.gz extra-cmake-modules-fd3a1772eded684647d10ac39f4eb2ef14ec0d9c.tar.bz2 |
-KDE4_AUTOMOC: give a better error message if the header which should exist for creating the moc file doesn't exist
This means that cmake will now abort if there is the header file which
is required for KDE4_AUTOMOC is missing at cmake time.
I think this shouldn't break anything, but I don't have enough computing power here to check all modules.
CCMAIL: kde-buildsystem@kde.org
CCMAIL: kde-core-devel@kde.org
Alex
svn path=/trunk/KDE/kdelibs/; revision=561632
Diffstat (limited to 'modules')
-rw-r--r-- | modules/KDE4Macros.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 45fd4c12..2158a81f 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -154,10 +154,13 @@ MACRO (KDE4_AUTOMOC) string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}") get_filename_component(_basename ${_current_MOC} NAME_WE) -# set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h) set(_header ${_abs_PATH}/${_basename}.h) set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) - #set(_moc ${_abs_PATH}/${_current_MOC}) + + if (NOT EXISTS ${_abs_PATH}/${_basename}.h) + message(FATAL_ERROR "In the file \"${_abs_FILE}\" the moc file \"${_current_MOC}\" is included, but \"${_abs_PATH}/${_basename}.h\" doesn't exist.") + endif (NOT EXISTS ${_abs_PATH}/${_basename}.h) + add_custom_command(OUTPUT ${_moc} COMMAND ${QT_MOC_EXECUTABLE} ARGS ${_moc_INCS} ${_header} -o ${_moc} |