[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/automoc
From:       Mike Arthur <mike () mikearthur ! co ! uk>
Date:       2010-03-15 22:07:33
Message-ID: 1268690853.850870.6191.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1103798 by mikearthur:

Fix framework detection on Mac where Qt is installed outside 
/Library/Frameworks.


 M  +11 -5     kde4automoc.cpp  


--- trunk/kdesupport/automoc/kde4automoc.cpp #1103797:1103798
@@ -179,16 +179,22 @@
     dotFilesCheck(line == "MOC_INCLUDES:\n");
     line = dotFiles.readLine().trimmed();
     const QStringList &incPaths = QString::fromUtf8(line).split(';', QString::SkipEmptyParts);
+    QSet<QString> frameworkPaths;
     foreach (const QString &path, incPaths) {
         Q_ASSERT(!path.isEmpty());
         mocIncludes << "-I" + path;
+        if (path.endsWith(".framework/Headers")) {
+            QDir framework(path);
+            // Go up twice to get to the framework root
+            framework.cdUp();
+            framework.cdUp();
+            frameworkPaths << framework.path();
+        }
     }
 
-    // on the Mac, add -F always, otherwise headers in the frameworks won't be found
-    // is it necessary to do this only optionally ? Alex
-#if defined(Q_OS_DARWIN) || defined(Q_OS_MAC)
-    mocIncludes << "-F/Library/Frameworks";
-#endif
+    foreach (const QString &path, frameworkPaths) {
+        mocIncludes << "-F" << path;
+    }
 
     line = dotFiles.readLine();
     dotFilesCheck(line == "CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE:\n");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic