aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-07-02 13:42:18 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-07-03 12:42:39 +0200
commit45828fdc323745aefb2bfc145c46b58dd7305241 (patch)
treebcca399a1de6b9ee900f85988257fea0bd4a105f /src
parent2c039adbb19ffe9fec27861f055cb46e8f3d0eb6 (diff)
read Qt.core defines from Qt build
We now read the defines needed for Qt.core from the Qt build instead of calculating them. This also enables us to remove the namespace property from Qt.core. Change-Id: I92bb20f3677eb2012a390f93cb2f047c616e7429 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/qtprofilesetup/qtprofilesetup.cpp12
-rw-r--r--src/lib/qtprofilesetup/templates/core.qbs5
2 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/qtprofilesetup/qtprofilesetup.cpp b/src/lib/qtprofilesetup/qtprofilesetup.cpp
index ea7c26246..ed9fcb8e6 100644
--- a/src/lib/qtprofilesetup/qtprofilesetup.cpp
+++ b/src/lib/qtprofilesetup/qtprofilesetup.cpp
@@ -221,8 +221,15 @@ static QStringList qt4ModuleIncludePaths(const QtEnvironment &qtEnvironment,
static QList<QtModuleInfo> qt4Modules(const QtEnvironment &qtEnvironment)
{
// as per http://qt-project.org/doc/qt-4.8/modules.html + private stuff.
- QList<QtModuleInfo> modules = QList<QtModuleInfo>()
- << QtModuleInfo(QLatin1String("QtCore"), QLatin1String("core"))
+ QList<QtModuleInfo> modules;
+
+ QtModuleInfo core(QLatin1String("QtCore"), QLatin1String("core"));
+ core.compilerDefines << QLatin1String("QT_CORE_LIB");
+ if (!qtEnvironment.qtNameSpace.isEmpty())
+ core.compilerDefines << QLatin1String("QT_NAMESPACE=") + qtEnvironment.qtNameSpace;
+
+ modules = QList<QtModuleInfo>()
+ << core
<< QtModuleInfo(QLatin1String("QtCore"), QLatin1String("core-private"),
QStringList() << QLatin1String("core"))
<< QtModuleInfo(QLatin1String("QtGui"), QLatin1String("gui"))
@@ -540,7 +547,6 @@ void doSetupQtProfile(const QString &profileName, Settings *settings,
profile.setValue(settingsTemplate.arg("mkspecPath"), qtEnvironment.mkspecPath);
profile.setValue(settingsTemplate.arg("docPath"), qtEnvironment.documentationPath);
profile.setValue(settingsTemplate.arg("version"), qtEnvironment.qtVersion);
- profile.setValue(settingsTemplate.arg("namespace"), qtEnvironment.qtNameSpace);
profile.setValue(settingsTemplate.arg("libInfix"), qtEnvironment.qtLibInfix);
profile.setValue(settingsTemplate.arg("buildVariant"), qtEnvironment.buildVariant);
profile.setValue(settingsTemplate.arg(QLatin1String("staticBuild")), staticBuild);
diff --git a/src/lib/qtprofilesetup/templates/core.qbs b/src/lib/qtprofilesetup/templates/core.qbs
index 13f3ed554..ee67d0ee4 100644
--- a/src/lib/qtprofilesetup/templates/core.qbs
+++ b/src/lib/qtprofilesetup/templates/core.qbs
@@ -9,7 +9,6 @@ Module {
Depends { name: "cpp" }
- property string namespace
property string libInfix: ""
property stringList config
property stringList qtConfig
@@ -43,13 +42,11 @@ Module {
property string libraryInfix: cpp.debugInformation ? 'd' : ''
cpp.defines: {
- var defines = ["QT_CORE_LIB"];
+ var defines = @defines@;
// ### QT_NO_DEBUG must be added if the current build variant is derived
// from the build variant "release"
if (!qbs.debugInformation)
defines.push("QT_NO_DEBUG");
- if (namespace)
- defines.push("QT_NAMESPACE=" + namespace);
if (qbs.targetOS.contains("ios"))
defines = defines.concat(["DARWIN_NO_CARBON", "QT_NO_CORESERVICES", "QT_NO_PRINTER",
"QT_NO_PRINTDIALOG", "main=qt_main"]);