From 27563451cb628643c090d336eca5d510a282b93e Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@digia.com>
Date: Thu, 12 Dec 2013 14:09:06 +0100
Subject: [PATCH] Allow plugins to depend on plugins outside of creator source
 tree

Do try to resolve plugin_dependencies.pri files in all directories
set by QTC_PLUGIN_DIRS. Also fail if a dependencies_pri file cannot
be resolved.

Change-Id: I2c14db832cef0fcc97a2f0351847c4969f5bd420
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
---
 qtcreator.pri | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/qtcreator.pri b/qtcreator.pri
index 522c46d097a..58e09a02003 100644
--- a/qtcreator.pri
+++ b/qtcreator.pri
@@ -153,8 +153,12 @@ macx {
 INCLUDEPATH += \
     $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
     $$IDE_SOURCE_TREE/src/libs \
-    $$IDE_SOURCE_TREE/tools \
-    $$IDE_SOURCE_TREE/src/plugins
+    $$IDE_SOURCE_TREE/tools
+
+QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
+for (dir, QTC_PLUGIN_DIRS) {
+    INCLUDEPATH += $$dir
+}
 
 CONFIG += depend_includepath
 
@@ -203,7 +207,16 @@ for(ever) {
         break()
     done_plugins += $$QTC_PLUGIN_DEPENDS
     for(dep, QTC_PLUGIN_DEPENDS) {
-        include($$PWD/src/plugins/$$dep/$${dep}_dependencies.pri)
+        dependencies_file =
+        for(dir, QTC_PLUGIN_DIRS) {
+            exists($$dir/$$dep/$${dep}_dependencies.pri) {
+                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
+                break()
+            }
+        }
+        isEmpty(dependencies_file): \
+            error("Plugin dependency $$dep not found")
+        include($$dependencies_file)
         LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
     }
     QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
-- 
GitLab