[Cmake-commits] CMake branch, next, updated. v2.8.10.1-941-g700f7b9
Alexander Neundorf
neundorf at kde.org
Mon Nov 19 15:53:22 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 700f7b9a9288280855dd1acf652c11c1408b2f39 (commit)
via 18056a683a86295e5471c2bc67b9b365c38a2383 (commit)
via 7a8da5fce1d6974a087c4a20b585ca0d900afbbb (commit)
via 843c1617d607d6aa5a3609b69190871bdced6948 (commit)
from df01c8d1a099316f9f3f164429d6209668c998a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=700f7b9a9288280855dd1acf652c11c1408b2f39
commit 700f7b9a9288280855dd1acf652c11c1408b2f39
Merge: df01c8d 18056a6
Author: Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Nov 19 15:53:21 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 19 15:53:21 2012 -0500
Merge topic 'FixAutomocRegression3' into next
18056a6 Automoc: fix regression #13667, broken build in phonon
7a8da5f CMake Nightly Date Stamp
843c161 CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18056a683a86295e5471c2bc67b9b365c38a2383
commit 18056a683a86295e5471c2bc67b9b365c38a2383
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Nov 19 21:47:20 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Nov 19 21:47:20 2012 +0100
Automoc: fix regression #13667, broken build in phonon
On some systems, ${QT_INCLUDE_DIR} is reported by gcc as a builtin
include search dir. Some projects use this information to extend
CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
In cmake 2.8.10 now the targets are queried for the include directories
they use. When they return the result, the include dirs contained in
CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES have been removed.
In cmake 2.8.9 and below the INCLUDE_DIRECTORIES directory property
was queried, where this had not been stripped.
So, in those projects which modify the implicit include dirs variable,
on systems where ${QT_INCLUDE_DIR} is reported by gcc, this directory,
e.g. /usr/lib/include/qt/, was not given anymore to moc. This made moc
not find required headers, so the build broke.
Simply giving the full CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES to moc
is no solution either, since moc can't handle some of the headers it
finds then (https://bugreports.qt-project.org/browse/QTBUG-28045).
So now cmake checks CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES, and if this
contains ${QT_INCLUDE_DIR}, and the target reports that it uses
${QT_QTCORE_INCLUDE_DIR} but not ${QT_INCLUDE_DIR}, ${QT_INCLUDE_DIR}
is added to the include dirs given to moc.
Alex
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 942c7ab..25614b8 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -195,6 +195,34 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
}
}
+
+ const char* qtIncDir = 0;
+ const char* qtCoreIncDir = 0;
+
+ // check whether ${QT_INCLUDE_DIR} is part of the implicit include dirs,
+ // see http://public.kitware.com/Bug/view.php?id=13667
+ bool qtIncludeDirMayHaveBeenRemoved = false;
+ if (makefile->IsSet("QT_INCLUDE_DIR"))
+ {
+ qtIncDir = makefile->GetDefinition("QT_INCLUDE_DIR");
+ std::string s =
+ makefile->GetSafeDefinition("CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES");
+ std::vector<std::string> implIncDirs;
+ cmSystemTools::ExpandListArgument(s, implIncDirs);
+ if (std::find(implIncDirs.begin(), implIncDirs.end(),std::string(qtIncDir))
+ != implIncDirs.end())
+ {
+ qtIncludeDirMayHaveBeenRemoved = true;
+ if (makefile->IsSet("QT_QTCORE_INCLUDE_DIR"))
+ {
+ qtCoreIncDir = makefile->GetDefinition("QT_QTCORE_INCLUDE_DIR");
+ }
+ }
+ }
+
+ bool haveQtCoreIncDir = false;
+ bool haveQtIncDir = false;
+
std::vector<std::string> includeDirs;
cmGeneratorTarget gtgt(target);
localGen->GetIncludeDirectories(includeDirs, >gt, "CXX");
@@ -207,6 +235,37 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
_moc_incs += sep;
sep = ";";
_moc_incs += *incDirIt;
+
+ if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir) // #13667
+ {
+ if (*incDirIt == qtIncDir)
+ {
+ haveQtIncDir = true;
+ qtIncludeDirMayHaveBeenRemoved = false; // it's here, i.e. not removed
+ }
+ if (*incDirIt == qtCoreIncDir)
+ {
+ haveQtCoreIncDir = true;
+ }
+ }
+ }
+
+ // Some projects (kdelibs, phonon) query the compiler for its default
+ // include search dirs, and add those to
+ // CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
+ // These may include e.g./usr/lib/qt/include . This is typically also part
+ // of ${QT_INCLUDES}. If this directory is then contained in the implicit
+ // include dirs, it is removed from the include dirs returned from the
+ // target above. So we add ${QT_INCLUDE_DIR} manually for moc if we detected
+ // that ${QT_QTCORE_INCLUDE_DIR} is among the include dirs (there shouldn't
+ // be a way to use Qt4 without using ${QT_QTCORE_INCLUDE_DIR} I think.
+ // See #13646 and #13667.
+ if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir
+ && (haveQtCoreIncDir == true) && (haveQtIncDir == false))
+ {
+ _moc_incs += sep;
+ sep = ";";
+ _moc_incs += qtIncDir;
}
const char* tmp = target->GetProperty("COMPILE_DEFINITIONS");
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeVersion.cmake | 2 +-
Source/cmQtAutomoc.cxx | 59 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list