[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1256-g874be9a

Alexander Neundorf neundorf at kde.org
Sat Dec 8 10:06:07 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  874be9a9d23e6028f4d49cc263683ec892fc798b (commit)
       via  acc224005e99076da3561ada8c06985487b0ce11 (commit)
       via  2be87f8ff832fc29daa3d4eca85de88130daa400 (commit)
      from  bb48cb26fb6660e915777fa6285d00c45e24ea55 (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=874be9a9d23e6028f4d49cc263683ec892fc798b
commit 874be9a9d23e6028f4d49cc263683ec892fc798b
Merge: bb48cb2 acc2240
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Sat Dec 8 10:06:05 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Dec 8 10:06:05 2012 -0500

    Merge topic 'TheRealAutomocIncludeDirFix' into next
    
    acc2240 Automoc: get include dirs without stripping implicit include dirs off
    2be87f8 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acc224005e99076da3561ada8c06985487b0ce11
commit acc224005e99076da3561ada8c06985487b0ce11
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Fri Dec 7 21:24:28 2012 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Fri Dec 7 21:24:28 2012 +0100

    Automoc: get include dirs without stripping implicit include dirs off
    
    This should finally fix #13667 and #13762.
    Instead of adding special handling to guess whether implicit include dirs
    may have been removed, simply make it possible to query the include dirs
    without removing the implicit ones.
    
    Alex

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6d396b3..b41f060 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1329,7 +1329,9 @@ std::string cmLocalGenerator::GetIncludeFlags(
 void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
                                              cmGeneratorTarget* target,
                                              const char* lang,
-                                             const char *config)
+                                             const char *config,
+                                             bool stripImplicitInclDirs
+                                            )
 {
   // Need to decide whether to automatically include the source and
   // binary directories at the beginning of the include path.
@@ -1404,18 +1406,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
     return;
     }
 
-  // Load implicit include directories for this language.
-  std::string impDirVar = "CMAKE_";
-  impDirVar += lang;
-  impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
-  if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
+  if (stripImplicitInclDirs)
     {
-    std::vector<std::string> impDirVec;
-    cmSystemTools::ExpandListArgument(value, impDirVec);
-    for(std::vector<std::string>::const_iterator i = impDirVec.begin();
-        i != impDirVec.end(); ++i)
+    // Load implicit include directories for this language.
+    std::string impDirVar = "CMAKE_";
+    impDirVar += lang;
+    impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
+    if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
       {
-      emitted.insert(*i);
+      std::vector<std::string> impDirVec;
+      cmSystemTools::ExpandListArgument(value, impDirVec);
+      for(std::vector<std::string>::const_iterator i = impDirVec.begin();
+          i != impDirVec.end(); ++i)
+        {
+        emitted.insert(*i);
+        }
       }
     }
 
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index bd58218..63559d7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -212,7 +212,8 @@ public:
   /** Get the include flags for the current makefile and language.  */
   void GetIncludeDirectories(std::vector<std::string>& dirs,
                              cmGeneratorTarget* target,
-                             const char* lang = "C", const char *config = 0);
+                             const char* lang = "C", const char *config = 0,
+                             bool stripImplicitInclDirs = true);
 
   /** Compute the language used to compile the given source file.  */
   const char* GetSourceFileLanguage(const cmSourceFile& source);
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 83688dd..bf034cf 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -212,36 +212,11 @@ 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, &gtgt, "CXX");
+  // Get the include dirs for this target, without stripping the implicit
+  // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
+  localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX", 0, false);
   std::string _moc_incs = "";
   const char* sep = "";
   for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
@@ -251,37 +226,6 @@ 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/cmLocalGenerator.cxx |   27 +++++++++++-------
 Source/cmLocalGenerator.h   |    3 +-
 Source/cmQtAutomoc.cxx      |   62 ++----------------------------------------
 4 files changed, 22 insertions(+), 72 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list