From 59a026594b225fc9e6fd8d4ffa6ee128bf3349ed Mon Sep 17 00:00:00 2001
From: Eike Ziller <eike.ziller@digia.com>
Date: Thu, 6 Mar 2014 14:17:40 +0100
Subject: [PATCH] Disable Qbs support when compiling with Qt4

Enabling C++11 for compiling the Qbs library gets pretty complicated
with Qt4. Mixing is not advisable (at least not on OS X where a
different stdlib is used in that case).

Change-Id: Ibad56dcf41bfed61f4d8ec8eb46c980768f24faf
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
---
 README                  |  2 +-
 src/libs/libs.pro       | 26 +++++++++++++++-----------
 src/plugins/plugins.pro | 10 +++++-----
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/README b/README
index 535a44a0c43..8d8e88d0d3b 100644
--- a/README
+++ b/README
@@ -12,7 +12,7 @@ Mac OS X 10.7 or later
 
 Building the sources requires Qt 5.2.0 or later.
 It is also possible to build with Qt 4.8.x, but in that case the Welcome mode,
-Qt Quick Designer and QML Profiler are disabled.
+Qt Quick Designer, QML Profiler and Qbs support are disabled.
 
 Compiling Qt Creator
 ====================
diff --git a/src/libs/libs.pro b/src/libs/libs.pro
index 894d867b4c3..085a014bd0f 100644
--- a/src/libs/libs.pro
+++ b/src/libs/libs.pro
@@ -1,3 +1,5 @@
+include(../../qtcreator.pri)
+
 TEMPLATE  = subdirs
 
 SUBDIRS   = \
@@ -23,17 +25,19 @@ for(l, SUBDIRS) {
 SUBDIRS += \
     utils/process_stub.pro
 
-QBS_DIRS = \
-    corelib \
-    qtprofilesetup \
-    ../shared/qbs/src/plugins \
-    ../shared/qbs/static.pro
-corelib.subdir = ../shared/qbs/src/lib/corelib
-qtprofilesetup.subdir = ../shared/qbs/src/lib/qtprofilesetup
-qtprofilesetup.depends = corelib
-
-exists(../shared/qbs/qbs.pro): SUBDIRS += $$QBS_DIRS
-TR_EXCLUDE = $$QBS_DIRS
+minQtVersion(5, 0, 0) {
+    QBS_DIRS = \
+        corelib \
+        qtprofilesetup \
+        ../shared/qbs/src/plugins \
+        ../shared/qbs/static.pro
+    corelib.subdir = ../shared/qbs/src/lib/corelib
+    qtprofilesetup.subdir = ../shared/qbs/src/lib/qtprofilesetup
+    qtprofilesetup.depends = corelib
+
+    exists(../shared/qbs/qbs.pro): SUBDIRS += $$QBS_DIRS
+    TR_EXCLUDE = $$QBS_DIRS
+}
 
 win32:SUBDIRS += utils/process_ctrlc_stub.pro
 
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index c910d6be58e..8d377df12bc 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -53,6 +53,11 @@ SUBDIRS   = \
 
 minQtVersion(5, 0, 0) {
     SUBDIRS += winrt
+
+    isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
+    exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \
+        SUBDIRS += \
+            qbsprojectmanager
 }
 
 # prefer qmake variable set on command line over env var
@@ -61,11 +66,6 @@ isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR)
     SUBDIRS += clangcodemodel
 }
 
-isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
-exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \
-    SUBDIRS += \
-        qbsprojectmanager
-
 isEmpty(IDE_PACKAGE_MODE) {
     SUBDIRS += \
         helloworld \
-- 
GitLab