/[gentoo-x86]/dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch
Gentoo

Contents of /dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jan 1 19:25:58 2013 UTC (22 months, 3 weeks ago) by creffett
Branch: MAIN
Revision bump. Add patch to fix stripping implicit include dirs, bug 444340. Add shell-script magic in ebuild to strip extra jobs values in MAKEOPTS (which causes build failures), bug 447040.

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key 42618354)

1 --- a/Source/cmLocalGenerator.cxx
2 +++ b/Source/cmLocalGenerator.cxx
3 @@ -1329,7 +1329,9 @@ std::string cmLocalGenerator::GetIncludeFlags(
4 void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
5 cmGeneratorTarget* target,
6 const char* lang,
7 - const char *config)
8 + const char *config,
9 + bool stripImplicitInclDirs
10 + )
11 {
12 // Need to decide whether to automatically include the source and
13 // binary directories at the beginning of the include path.
14 @@ -1404,18 +1406,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
15 return;
16 }
17
18 - // Load implicit include directories for this language.
19 - std::string impDirVar = "CMAKE_";
20 - impDirVar += lang;
21 - impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
22 - if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
23 + if (stripImplicitInclDirs)
24 {
25 - std::vector<std::string> impDirVec;
26 - cmSystemTools::ExpandListArgument(value, impDirVec);
27 - for(std::vector<std::string>::const_iterator i = impDirVec.begin();
28 - i != impDirVec.end(); ++i)
29 + // Load implicit include directories for this language.
30 + std::string impDirVar = "CMAKE_";
31 + impDirVar += lang;
32 + impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
33 + if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
34 {
35 - emitted.insert(*i);
36 + std::vector<std::string> impDirVec;
37 + cmSystemTools::ExpandListArgument(value, impDirVec);
38 + for(std::vector<std::string>::const_iterator i = impDirVec.begin();
39 + i != impDirVec.end(); ++i)
40 + {
41 + emitted.insert(*i);
42 + }
43 }
44 }
45
46 --- a/Source/cmLocalGenerator.h
47 +++ b/Source/cmLocalGenerator.h
48 @@ -212,7 +212,8 @@ public:
49 /** Get the include flags for the current makefile and language. */
50 void GetIncludeDirectories(std::vector<std::string>& dirs,
51 cmGeneratorTarget* target,
52 - const char* lang = "C", const char *config = 0);
53 + const char* lang = "C", const char *config = 0,
54 + bool stripImplicitInclDirs = true);
55
56 /** Compute the language used to compile the given source file. */
57 const char* GetSourceFileLanguage(const cmSourceFile& source);
58 --- a/Source/cmQtAutomoc.cxx
59 +++ b/Source/cmQtAutomoc.cxx
60 @@ -212,36 +212,11 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
61 }
62
63
64 - const char* qtIncDir = 0;
65 - const char* qtCoreIncDir = 0;
66 -
67 - // check whether ${QT_INCLUDE_DIR} is part of the implicit include dirs,
68 - // see http://public.kitware.com/Bug/view.php?id=13667
69 - bool qtIncludeDirMayHaveBeenRemoved = false;
70 - if (makefile->IsSet("QT_INCLUDE_DIR"))
71 - {
72 - qtIncDir = makefile->GetDefinition("QT_INCLUDE_DIR");
73 - std::string s =
74 - makefile->GetSafeDefinition("CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES");
75 - std::vector<std::string> implIncDirs;
76 - cmSystemTools::ExpandListArgument(s, implIncDirs);
77 - if (std::find(implIncDirs.begin(), implIncDirs.end(),std::string(qtIncDir))
78 - != implIncDirs.end())
79 - {
80 - qtIncludeDirMayHaveBeenRemoved = true;
81 - if (makefile->IsSet("QT_QTCORE_INCLUDE_DIR"))
82 - {
83 - qtCoreIncDir = makefile->GetDefinition("QT_QTCORE_INCLUDE_DIR");
84 - }
85 - }
86 - }
87 -
88 - bool haveQtCoreIncDir = false;
89 - bool haveQtIncDir = false;
90 -
91 std::vector<std::string> includeDirs;
92 cmGeneratorTarget gtgt(target);
93 - localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX");
94 + // Get the include dirs for this target, without stripping the implicit
95 + // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
96 + localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX", 0, false);
97 std::string _moc_incs = "";
98 const char* sep = "";
99 for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
100 @@ -251,37 +226,6 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
101 _moc_incs += sep;
102 sep = ";";
103 _moc_incs += *incDirIt;
104 -
105 - if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir) // #13667
106 - {
107 - if (*incDirIt == qtIncDir)
108 - {
109 - haveQtIncDir = true;
110 - qtIncludeDirMayHaveBeenRemoved = false; // it's here, i.e. not removed
111 - }
112 - if (*incDirIt == qtCoreIncDir)
113 - {
114 - haveQtCoreIncDir = true;
115 - }
116 - }
117 - }
118 -
119 - // Some projects (kdelibs, phonon) query the compiler for its default
120 - // include search dirs, and add those to
121 - // CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
122 - // These may include e.g./usr/lib/qt/include . This is typically also part
123 - // of ${QT_INCLUDES}. If this directory is then contained in the implicit
124 - // include dirs, it is removed from the include dirs returned from the
125 - // target above. So we add ${QT_INCLUDE_DIR} manually for moc if we detected
126 - // that ${QT_QTCORE_INCLUDE_DIR} is among the include dirs (there shouldn't
127 - // be a way to use Qt4 without using ${QT_QTCORE_INCLUDE_DIR} I think.
128 - // See #13646 and #13667.
129 - if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir
130 - && (haveQtCoreIncDir == true) && (haveQtIncDir == false))
131 - {
132 - _moc_incs += sep;
133 - sep = ";";
134 - _moc_incs += qtIncDir;
135 }
136
137 const char* tmp = target->GetProperty("COMPILE_DEFINITIONS");
138 --
139 1.7.0

  ViewVC Help
Powered by ViewVC 1.1.20