From 9b2e95ca633f1025cc19e713adbe9c72253c169675bc95beb8e316e74e6efc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 29 Nov 2012 08:22:26 +0000 Subject: [PATCH 1/2] Accepting request 142957 from home:tittiatcoke:branches:devel:tools:building A regression from cmake 2.8.9 was detected and reported in cmake bug#0013667. This SR fixes this issue based on the upstream fix. OBS-URL: https://build.opensuse.org/request/show/142957 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=104 --- cmake-fix-qt-includes.diff | 110 +++++++++++++++++++++++++++++++++++++ cmake.changes | 6 ++ cmake.spec | 3 + 3 files changed, 119 insertions(+) create mode 100644 cmake-fix-qt-includes.diff diff --git a/cmake-fix-qt-includes.diff b/cmake-fix-qt-includes.diff new file mode 100644 index 0000000..59e0197 --- /dev/null +++ b/cmake-fix-qt-includes.diff @@ -0,0 +1,110 @@ +From d2536579d51e77827b8e55f39123316324314781 Mon Sep 17 00:00:00 2001 +From: Alex Neundorf +Date: Mon, 19 Nov 2012 21:47:20 +0100 +Subject: [PATCH] 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 +--- + Source/cmQtAutomoc.cxx | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 59 insertions(+), 0 deletions(-) + +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 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 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"); +-- +1.7.0 + diff --git a/cmake.changes b/cmake.changes index 0997ca3..be4c7bd 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 26 19:56:15 UTC 2012 - tittiatcoke@gmail.com + +- Add cmake-fix-qt-includes.diff to fix the missing qt_include_dir. + This was reported as cmake regression from 2.8.9 (kitware#0013667). + ------------------------------------------------------------------- Wed Nov 14 12:55:10 UTC 2012 - idonmez@suse.com diff --git a/cmake.spec b/cmake.spec index 2575802..e835e97 100644 --- a/cmake.spec +++ b/cmake.spec @@ -24,6 +24,8 @@ Source0: http://www.cmake.org/files/v2.8/%{name}-%{version}.tar.gz Patch1: cmake-disable-builtin-chrpath.diff Patch2: cmake-fix-ruby-test.patch Patch3: cmake-gettext.patch +# PATCH-FIX-UPSTREAM Fix the missing QT_INCLUDE_DIR (bug#13667, bko#309718) +Patch4: cmake-fix-qt-includes.diff Summary: Cross-platform, open-source make system License: BSD-3-Clause Group: Development/Tools/Building @@ -53,6 +55,7 @@ CMake is a cross-platform, open-source make system %patch1 %patch2 %patch3 -p1 +%patch4 -p1 %build export CXXFLAGS="$RPM_OPT_FLAGS" From a872c22a5e22169b086a4360a8e97147089ee9cafc54fd94207b56fdebe7102e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 29 Nov 2012 13:05:55 +0000 Subject: [PATCH 2/2] Accepting request 143520 from home:cgiboudeaux:branches:devel:tools:building Update to 2.8.10.2 OBS-URL: https://build.opensuse.org/request/show/143520 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=105 --- cmake-2.8.10.1.tar.gz | 3 - cmake-2.8.10.2.tar.gz | 3 + cmake-fix-qt-includes.diff | 110 ------------------------------------- cmake-gettext.patch | 10 ---- cmake-gui.changes | 9 +++ cmake-gui.spec | 2 +- cmake.changes | 9 +++ cmake.spec | 7 +-- 8 files changed, 23 insertions(+), 130 deletions(-) delete mode 100644 cmake-2.8.10.1.tar.gz create mode 100644 cmake-2.8.10.2.tar.gz delete mode 100644 cmake-fix-qt-includes.diff delete mode 100644 cmake-gettext.patch diff --git a/cmake-2.8.10.1.tar.gz b/cmake-2.8.10.1.tar.gz deleted file mode 100644 index c51fcb4..0000000 --- a/cmake-2.8.10.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbfb9d609e8fdb6f0947993246c11e2ee5d47944d6e7bd9314463b31e420e6e0 -size 5767574 diff --git a/cmake-2.8.10.2.tar.gz b/cmake-2.8.10.2.tar.gz new file mode 100644 index 0000000..54b0ebd --- /dev/null +++ b/cmake-2.8.10.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce524fb39da06ee6d47534bbcec6e0b50422e18b62abc4781a4ba72ea2910eb1 +size 5768373 diff --git a/cmake-fix-qt-includes.diff b/cmake-fix-qt-includes.diff deleted file mode 100644 index 59e0197..0000000 --- a/cmake-fix-qt-includes.diff +++ /dev/null @@ -1,110 +0,0 @@ -From d2536579d51e77827b8e55f39123316324314781 Mon Sep 17 00:00:00 2001 -From: Alex Neundorf -Date: Mon, 19 Nov 2012 21:47:20 +0100 -Subject: [PATCH] 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 ---- - Source/cmQtAutomoc.cxx | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 59 insertions(+), 0 deletions(-) - -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 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 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"); --- -1.7.0 - diff --git a/cmake-gettext.patch b/cmake-gettext.patch deleted file mode 100644 index 397d50b..0000000 --- a/cmake-gettext.patch +++ /dev/null @@ -1,10 +0,0 @@ -Index: cmake-2.8.10.1/Modules/FindGettext.cmake -=================================================================== ---- cmake-2.8.10.1.orig/Modules/FindGettext.cmake -+++ cmake-2.8.10.1/Modules/FindGettext.cmake -@@ -209,5 +209,3 @@ function(GETTEXT_PROCESS_PO_FILES _lang) - add_dependencies(pofiles ${uniqueTargetName}) - - endfunction() -- --set(GETTEXT_FOUND ${Gettext_FOUND}) diff --git a/cmake-gui.changes b/cmake-gui.changes index fdc770c..6aa3518 100644 --- a/cmake-gui.changes +++ b/cmake-gui.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Nov 28 00:29:29 UTC 2012 - cgiboudeaux@gmx.com + +- Update to 2.8.10.2 + * Fix kitware#0013691: [Modules] FindGettext.cmake does not set GETTEXT_FOUND on success + * Fix kitware#0013702: [CMake] CMake crashes when reconfiguring build + * Fix kitware#0013667: [CMake] Automoc fails to handle Q_INTERFACES +- Drop obsolete patches + ------------------------------------------------------------------- Wed Nov 7 21:24:45 UTC 2012 - cgiboudeaux@gmx.com diff --git a/cmake-gui.spec b/cmake-gui.spec index c6bd47b..607c522 100644 --- a/cmake-gui.spec +++ b/cmake-gui.spec @@ -17,7 +17,7 @@ Name: cmake-gui -Version: 2.8.10.1 +Version: 2.8.10.2 Release: 0 Url: http://www.cmake.org/ Source0: http://www.cmake.org/files/v2.8/cmake-%{version}.tar.gz diff --git a/cmake.changes b/cmake.changes index be4c7bd..572d063 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Nov 28 00:29:29 UTC 2012 - cgiboudeaux@gmx.com + +- Update to 2.8.10.2 + * Fix kitware#0013691: [Modules] FindGettext.cmake does not set GETTEXT_FOUND on success + * Fix kitware#0013702: [CMake] CMake crashes when reconfiguring build + * Fix kitware#0013667: [CMake] Automoc fails to handle Q_INTERFACES +- Drop obsolete patches + ------------------------------------------------------------------- Mon Nov 26 19:56:15 UTC 2012 - tittiatcoke@gmail.com diff --git a/cmake.spec b/cmake.spec index e835e97..20e3c01 100644 --- a/cmake.spec +++ b/cmake.spec @@ -17,15 +17,12 @@ Name: cmake -Version: 2.8.10.1 +Version: 2.8.10.2 Release: 0 Url: http://www.cmake.org/ Source0: http://www.cmake.org/files/v2.8/%{name}-%{version}.tar.gz Patch1: cmake-disable-builtin-chrpath.diff Patch2: cmake-fix-ruby-test.patch -Patch3: cmake-gettext.patch -# PATCH-FIX-UPSTREAM Fix the missing QT_INCLUDE_DIR (bug#13667, bko#309718) -Patch4: cmake-fix-qt-includes.diff Summary: Cross-platform, open-source make system License: BSD-3-Clause Group: Development/Tools/Building @@ -54,8 +51,6 @@ CMake is a cross-platform, open-source make system %setup -q %patch1 %patch2 -%patch3 -p1 -%patch4 -p1 %build export CXXFLAGS="$RPM_OPT_FLAGS"