diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-10 17:16:32 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-16 16:51:48 +0100 |
commit | f4b6d84baa16440812127099f7b03ec79f87bd2a (patch) | |
tree | 2f0e8a7959cc357684e887297faa4792b11facad /src/lib/qtprofilesetup/templates/QtModule.qbs | |
parent | 008992106eea60f0a63efc0978399c454fdab2ca (diff) |
Move knowledge about Qt modules into libsetupqt.
In addition, we make less hard-coded assumptions than before, instead
generating almost all modules dynamically from the respective Qt
installation when setup-qt is being run. This way, qbs does not have
to know about all the modules beforehand, and only the Qt modules that
are actually present will have qbs counterparts, making it possible
for project file authors to make use of soft dependencies for
Qt modules.
Task-number: QBS-479
Change-Id: Ie20d2acf249cd159ce4caff2ede4721ab879fad2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/qtprofilesetup/templates/QtModule.qbs')
-rw-r--r-- | src/lib/qtprofilesetup/templates/QtModule.qbs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/qtprofilesetup/templates/QtModule.qbs b/src/lib/qtprofilesetup/templates/QtModule.qbs new file mode 100644 index 000000000..4694dbcb1 --- /dev/null +++ b/src/lib/qtprofilesetup/templates/QtModule.qbs @@ -0,0 +1,39 @@ +import qbs 1.0 +import qbs.FileInfo +import 'qtfunctions.js' as QtFunctions + +Module { + Depends { name: "cpp" } + Depends { name: "Qt.core" } + + property string qtModuleName + property path binPath: Qt.core.binPath + property path incPath: Qt.core.incPath + property path libPath: Qt.core.libPath + property string qtLibInfix: Qt.core.libInfix + property string repository: Qt.core.versionMajor === 5 ? 'qtbase' : undefined + property string includeDirName: 'Qt' + qtModuleName + property string internalLibraryName: QtFunctions.getQtLibraryName(qtModuleName + qtLibInfix, Qt.core, qbs) + property string qtVersion: Qt.core.version + property bool hasLibrary: true + + Properties { + condition: qtModuleName != undefined + + cpp.includePaths: { + var modulePath = FileInfo.joinPaths(incPath, includeDirName); + var paths = [incPath, modulePath]; + if (Qt.core.versionMajor >= 5) + paths.unshift(FileInfo.joinPaths(modulePath, qtVersion, includeDirName)); + if (Qt.core.frameworkBuild) + paths.unshift(libPath + '/' + includeDirName + qtLibInfix + '.framework/Versions/' + Qt.core.versionMajor + '/Headers'); + return paths; + } + + cpp.dynamicLibraries: Qt.core.frameworkBuild || !hasLibrary + ? undefined : [internalLibraryName] + cpp.frameworks: Qt.core.frameworkBuild && hasLibrary ? [internalLibraryName] : undefined + cpp.defines: qtModuleName.contains("private") + ? [] : [ "QT_" + qtModuleName.toUpperCase() + "_LIB" ] + } +} |