Commit 26b8acb2 authored by Christian Kandeler's avatar Christian Kandeler

Support QbsProjectManager in qbs build.

Qbs can come in via the submodule or as an external resource.

Change-Id: I613982135e4a7eca1aeb5c9c305c9974fd65f0fe
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent 4677389a
......@@ -5,10 +5,28 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "QbsProjectManager"
property var qbs_source_dir: qbs.getenv("QBS_SOURCE_DIR")
property var qbs_build_dir: qbs.getenv("QBS_BUILD_DIR")
property var externalQbsDefines: project.useExternalQbs
? ['QBS_BUILD_DIR="' + project.qbs_build_dir +'"'] : []
property var externalQbsIncludes: project.useExternalQbs ? [project.qbs_source_dir + "/src/lib"] : []
property var externalQbsLibraryPaths: project.useExternalQbs ? [project.qbs_build_dir + "/lib"] : []
property var externalQbsRPaths: project.useExternalQbs ? [project.qbs_build_dir + "/lib"] : []
property var externalQbsDynamicLibraries: {
var libs = []
if (!project.useExternalQbs)
return libs;
if (qbs.targetOS.contains("windows")) {
libs.push("shell32")
if (qbs.enableDebugCode)
libs.push("qbscored")
else
libs.push("qbscore")
} else {
libs.push("qbscore")
}
return libs
}
condition: qbs_source_dir !== undefined && qbs_build_dir !== undefined
condition: project.useExternalQbs || project.qbsSubModuleExists
Depends { name: "Qt"; submodules: [ "widgets", "script" ] }
Depends { name: "ProjectExplorer" }
......@@ -18,34 +36,18 @@ QtcPlugin {
Depends { name: "QtSupport" }
Depends { name: "QmlJS" }
Depends { name: "QmlJSTools" }
cpp.includePaths: base.concat([
qbs_source_dir + "/src",
qbs_source_dir + "/src/lib",
])
Depends {
name: "qbscore"
condition: project.qbsSubModuleExists && !project.useExternalQbs
}
cpp.defines: base.concat([
'QBS_SOURCE_DIR="' + qbs_source_dir + '"',
'QBS_BUILD_DIR="' + qbs_build_dir +'"',
'QML_BUILD_STATIC_LIB'
])
cpp.libraryPaths: base.concat([qbs_build_dir + "/lib"])
cpp.rpaths: base.concat([qbs_build_dir + "/lib"])
cpp.dynamicLibraries: {
var libs = []
if (qbs.targetOS.contains("windows")) {
libs.push("shell32")
if (qbs.enableDebugCode)
libs.push("qbscored")
else
libs.push("qbscore")
} else {
libs.push("qbscore")
}
return libs
}
]).concat(externalQbsDefines)
cpp.includePaths: base.concat(externalQbsIncludes)
cpp.libraryPaths: base.concat(externalQbsLibraryPaths)
cpp.rpaths: base.concat(externalQbsRPaths)
cpp.dynamicLibraries: base.concat(externalQbsDynamicLibraries)
files: [
"qbsbuildconfiguration.cpp",
......
import qbs
import qbs.File
Project {
name: "Sources"
......@@ -9,4 +10,28 @@ Project {
"plugins/plugins.qbs",
"tools/tools.qbs"
]
property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs")
property path qbs_build_dir: qbs.getenv("QBS_BUILD_DIR")
property path qbs_source_dir: qbs.getenv("QBS_SOURCE_DIR")
property bool useExternalQbs: qbs_build_dir && qbs_source_dir
Project {
name: "qbs"
id: qbsProject
property string qbsBaseDir: path + "/shared/qbs"
condition: qbsSubModuleExists && !useExternalQbs
property bool enableUnitTests: false
property bool installApiHeaders: false
property path libInstallDir: project.ide_library_path
property path libRPaths: qbs.targetOS.contains("osx")
? ["@loader_path/.."] : ["$ORIGIN/.."]
property path resourcesInstallDir: project.ide_data_path + "/qbs"
references: [
qbsBaseDir + "/src/lib/lib.qbs",
qbsBaseDir + "/src/plugins/plugins.qbs",
qbsBaseDir + "/share/share.qbs"
]
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment