Rex Dieter 29094f2
From a003654d36b9e409931d15af68091d1f366bd46e Mon Sep 17 00:00:00 2001
Rex Dieter 29094f2
From: David Faure <faure@kde.org>
Rex Dieter 29094f2
Date: Thu, 16 Jun 2011 08:49:28 +0200
Rex Dieter 29094f2
Subject: [PATCH 29/33] Fix missing include dirs (current source and build dir)
Rex Dieter 29094f2
 when moc is run.
Rex Dieter 29094f2
Rex Dieter 29094f2
Apparently these dirs are not in the directory property "INCLUDE_DIRECTORIES",
Rex Dieter 29094f2
so they need to be added by hand.
Rex Dieter 29094f2
Rex Dieter 29094f2
This fixes compilation of kdelibs/kdewebkit with KDE_NO_DEPRECATED=TRUE:
Rex Dieter 29094f2
moc didn't find kdewebkit_export.h (and silently ignored it), so kdemacros.h
Rex Dieter 29094f2
was not included, and KDE_NO_DEPRECATED was not set, leading to signals
Rex Dieter 29094f2
only in the moc file and not in the header file, at compile time.
Rex Dieter 29094f2
Rex Dieter 29094f2
Alex: is there a way to only do this when CMAKE_INCLUDE_CURRENT_DIR is on?
Rex Dieter 29094f2
CCMAIL: neundorf@kde.org
Rex Dieter 29094f2
---
Rex Dieter 29094f2
 Automoc4Config.cmake | 6 ++++++
Rex Dieter 29094f2
 1 file changed, 6 insertions(+)
Rex Dieter 29094f2
Rex Dieter 29094f2
diff --git a/Automoc4Config.cmake b/Automoc4Config.cmake
Rex Dieter 29094f2
index d608513..f0dc204 100644
Rex Dieter 29094f2
--- a/Automoc4Config.cmake
Rex Dieter 29094f2
+++ b/Automoc4Config.cmake
Rex Dieter 29094f2
@@ -135,6 +135,9 @@ macro(AUTOMOC4 _target_NAME _SRCS)
Rex Dieter 29094f2
       get_directory_property(_moc_defs DEFINITIONS)
Rex Dieter 29094f2
       get_directory_property(_moc_cdefs COMPILE_DEFINITIONS)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+      # Assume CMAKE_INCLUDE_CURRENT_DIR is set
Rex Dieter 29094f2
+      list(APPEND _moc_incs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
Rex Dieter 29094f2
+
Rex Dieter 29094f2
       # configure_file replaces _moc_files, _moc_incs, _moc_cdefs and _moc_defs
Rex Dieter 29094f2
       configure_file(${_AUTOMOC4_CURRENT_DIR}/automoc4.files.in ${_automoc_source}.files)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
@@ -198,6 +201,9 @@ macro(_ADD_AUTOMOC4_TARGET _target_NAME _SRCS)
Rex Dieter 29094f2
       get_directory_property(_moc_defs DEFINITIONS)
Rex Dieter 29094f2
       get_directory_property(_moc_cdefs COMPILE_DEFINITIONS)
Rex Dieter 29094f2
 
Rex Dieter 29094f2
+      # Assume CMAKE_INCLUDE_CURRENT_DIR is set
Rex Dieter 29094f2
+      list(APPEND _moc_incs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
Rex Dieter 29094f2
+
Rex Dieter 29094f2
       # configure_file replaces _moc_files, _moc_incs, _moc_cdefs and _moc_defs
Rex Dieter 29094f2
       configure_file(${_AUTOMOC4_CURRENT_DIR}/automoc4.files.in ${_automoc_dotFiles})
Rex Dieter 29094f2
 
Rex Dieter 29094f2
-- 
Rex Dieter 29094f2
2.4.3
Rex Dieter 29094f2