2014-03-11 11:30:14 +01:00
|
|
|
import qbs 1.0
|
2016-03-22 14:28:07 +01:00
|
|
|
import qbs.Environment
|
2016-01-22 11:09:37 +01:00
|
|
|
import qbs.FileInfo
|
2012-02-09 14:30:09 +01:00
|
|
|
|
|
|
|
Project {
|
2015-06-03 17:07:29 +02:00
|
|
|
name: "Qt Creator"
|
2016-03-22 19:26:30 +01:00
|
|
|
minimumQbsVersion: "1.5.0"
|
2013-08-26 17:50:02 +02:00
|
|
|
property bool withAutotests: qbs.buildVariant === "debug"
|
2016-04-22 13:43:16 +02:00
|
|
|
property string licenseType: "opensource"
|
2016-03-07 11:36:35 +01:00
|
|
|
property string ide_version_major: '4'
|
|
|
|
property string ide_version_minor: '0'
|
2015-12-15 11:57:10 +01:00
|
|
|
property string ide_version_release: '82'
|
2012-02-09 14:30:09 +01:00
|
|
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
|
2016-03-07 11:36:35 +01:00
|
|
|
property string ide_compat_version_major: '4'
|
|
|
|
property string ide_compat_version_minor: '0'
|
2015-12-15 11:57:10 +01:00
|
|
|
property string ide_compat_version_release: '82'
|
2013-07-05 10:40:51 +02:00
|
|
|
property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release
|
2013-09-05 14:56:45 +02:00
|
|
|
property path ide_source_tree: path
|
2013-06-25 18:17:15 +02:00
|
|
|
property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin"
|
|
|
|
property string ide_app_target: qbs.targetOS.contains("osx") ? "Qt Creator" : "qtcreator"
|
2013-10-01 10:33:41 +02:00
|
|
|
property pathList additionalPlugins: []
|
|
|
|
property pathList additionalLibs: []
|
|
|
|
property pathList additionalTools: []
|
2015-01-23 17:47:29 +01:00
|
|
|
property pathList additionalAutotests: []
|
2015-02-18 15:35:45 +01:00
|
|
|
property string sharedSourcesDir: path + "/src/shared"
|
2014-02-27 18:18:54 +01:00
|
|
|
property string libDirName: "lib"
|
2013-04-19 16:20:22 +02:00
|
|
|
property string ide_library_path: {
|
2013-06-25 18:17:15 +02:00
|
|
|
if (qbs.targetOS.contains("osx"))
|
2014-08-26 13:26:21 +02:00
|
|
|
return ide_app_target + ".app/Contents/Frameworks"
|
2013-06-20 14:43:33 +02:00
|
|
|
else if (qbs.targetOS.contains("windows"))
|
2013-04-19 16:20:22 +02:00
|
|
|
return ide_app_path
|
|
|
|
else
|
2014-02-27 18:18:54 +01:00
|
|
|
return libDirName + "/qtcreator"
|
2013-04-19 16:20:22 +02:00
|
|
|
}
|
|
|
|
property string ide_plugin_path: {
|
2013-06-25 18:17:15 +02:00
|
|
|
if (qbs.targetOS.contains("osx"))
|
2014-08-26 13:26:21 +02:00
|
|
|
return ide_app_target + ".app/Contents/PlugIns"
|
2013-06-20 14:43:33 +02:00
|
|
|
else if (qbs.targetOS.contains("windows"))
|
2014-02-27 18:18:54 +01:00
|
|
|
return libDirName + "/qtcreator/plugins"
|
2013-04-19 16:20:22 +02:00
|
|
|
else
|
|
|
|
return ide_library_path + "/plugins"
|
|
|
|
}
|
2013-06-25 18:17:15 +02:00
|
|
|
property string ide_data_path: qbs.targetOS.contains("osx")
|
2013-06-20 14:43:33 +02:00
|
|
|
? ide_app_target + ".app/Contents/Resources"
|
|
|
|
: "share/qtcreator"
|
2013-06-25 18:17:15 +02:00
|
|
|
property string ide_libexec_path: qbs.targetOS.contains("osx")
|
2015-07-03 15:39:49 +02:00
|
|
|
? ide_data_path : qbs.targetOS.contains("windows")
|
|
|
|
? ide_app_path
|
|
|
|
: "libexec/qtcreator"
|
2013-06-25 18:17:15 +02:00
|
|
|
property string ide_doc_path: qbs.targetOS.contains("osx")
|
2013-06-20 14:43:33 +02:00
|
|
|
? ide_data_path + "/doc"
|
|
|
|
: "share/doc/qtcreator"
|
2013-06-25 18:17:15 +02:00
|
|
|
property string ide_bin_path: qbs.targetOS.contains("osx")
|
2013-06-20 14:43:33 +02:00
|
|
|
? ide_app_target + ".app/Contents/MacOS"
|
|
|
|
: ide_app_path
|
2016-03-22 14:28:07 +01:00
|
|
|
property bool testsEnabled: Environment.getEnv("TEST") || qbs.buildVariant === "debug"
|
2013-09-05 17:24:24 +02:00
|
|
|
property stringList generalDefines: [
|
|
|
|
"QT_CREATOR",
|
2014-02-27 18:18:54 +01:00
|
|
|
'IDE_LIBRARY_BASENAME="' + libDirName + '"',
|
2013-09-05 17:24:24 +02:00
|
|
|
"QT_NO_CAST_TO_ASCII",
|
2016-03-17 13:52:43 +01:00
|
|
|
"QT_RESTRICTED_CAST_FROM_ASCII"
|
2013-09-05 17:24:24 +02:00
|
|
|
].concat(testsEnabled ? ["WITH_TESTS"] : [])
|
2013-10-02 17:52:45 +02:00
|
|
|
qbsSearchPaths: "qbs"
|
2012-02-09 14:30:09 +01:00
|
|
|
|
|
|
|
references: [
|
2016-04-22 13:43:16 +02:00
|
|
|
"doc/doc.qbs",
|
2013-06-21 13:12:30 +02:00
|
|
|
"src/src.qbs",
|
2012-02-09 14:30:09 +01:00
|
|
|
"share/share.qbs",
|
2012-09-24 12:02:35 +02:00
|
|
|
"share/qtcreator/translations/translations.qbs",
|
2013-08-26 17:50:02 +02:00
|
|
|
"tests/tests.qbs"
|
2012-02-09 14:30:09 +01:00
|
|
|
]
|
2014-12-18 11:23:03 +01:00
|
|
|
|
2016-01-22 11:09:37 +01:00
|
|
|
AutotestRunner {
|
|
|
|
Depends { name: "Qt.core" }
|
|
|
|
environment: {
|
|
|
|
var env = base;
|
|
|
|
if (!qbs.hostOS.contains("windows") || !qbs.targetOS.contains("windows"))
|
|
|
|
return env;
|
|
|
|
var path = "";
|
|
|
|
for (var i = 0; i < env.length; ++i) {
|
|
|
|
if (env[i].startsWith("PATH=")) {
|
|
|
|
path = env[i].substring(5);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var fullQtcInstallDir
|
|
|
|
= FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, qbs.InstallDir);
|
|
|
|
var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir, project.ide_library_path);
|
|
|
|
var fullPluginInstallDir
|
|
|
|
= FileInfo.joinPaths(fullQtcInstallDir, project.ide_plugin_path);
|
|
|
|
path = Qt.core.binPath + ";" + fullLibInstallDir + ";" + fullPluginInstallDir
|
|
|
|
+ ";" + path;
|
|
|
|
var arrayElem = "PATH=" + path;
|
|
|
|
if (i < env.length)
|
|
|
|
env[i] = arrayElem;
|
|
|
|
else
|
|
|
|
env.push(arrayElem);
|
|
|
|
return env;
|
|
|
|
}
|
|
|
|
}
|
2012-02-09 14:30:09 +01:00
|
|
|
}
|