Commit a003654d authored by David Faure's avatar David Faure

Fix missing include dirs (current source and build dir) when moc is run.

Apparently these dirs are not in the directory property "INCLUDE_DIRECTORIES",
so they need to be added by hand.

This fixes compilation of kdelibs/kdewebkit with KDE_NO_DEPRECATED=TRUE:
moc didn't find kdewebkit_export.h (and silently ignored it), so kdemacros.h
was not included, and KDE_NO_DEPRECATED was not set, leading to signals
only in the moc file and not in the header file, at compile time.

Alex: is there a way to only do this when CMAKE_INCLUDE_CURRENT_DIR is on?
CCMAIL: neundorf@kde.org
parent 0fc7d228
......@@ -135,6 +135,9 @@ macro(AUTOMOC4 _target_NAME _SRCS)
get_directory_property(_moc_defs DEFINITIONS)
get_directory_property(_moc_cdefs COMPILE_DEFINITIONS)
# Assume CMAKE_INCLUDE_CURRENT_DIR is set
list(APPEND _moc_incs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
# configure_file replaces _moc_files, _moc_incs, _moc_cdefs and _moc_defs
configure_file(${_AUTOMOC4_CURRENT_DIR}/automoc4.files.in ${_automoc_source}.files)
......@@ -198,6 +201,9 @@ macro(_ADD_AUTOMOC4_TARGET _target_NAME _SRCS)
get_directory_property(_moc_defs DEFINITIONS)
get_directory_property(_moc_cdefs COMPILE_DEFINITIONS)
# Assume CMAKE_INCLUDE_CURRENT_DIR is set
list(APPEND _moc_incs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
# configure_file replaces _moc_files, _moc_incs, _moc_cdefs and _moc_defs
configure_file(${_AUTOMOC4_CURRENT_DIR}/automoc4.files.in ${_automoc_dotFiles})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment