KDE/kdelibs/cmake/modules

Alexander Neundorf neundorf at kde.org
Wed Jul 12 21:34:44 CEST 2006


SVN commit 561632 by neundorf:

-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 at kde.org
CCMAIL: kde-core-devel at kde.org

Alex



 M  +5 -2      KDE4Macros.cmake  


--- trunk/KDE/kdelibs/cmake/modules/KDE4Macros.cmake #561631:561632
@@ -154,10 +154,13 @@
                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}


More information about the Kde-buildsystem mailing list