From fd3a1772eded684647d10ac39f4eb2ef14ec0d9c Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 12 Jul 2006 19:34:41 +0000 Subject: -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 --- modules/KDE4Macros.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules') 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} -- cgit v1.2.1