diff options
Diffstat (limited to 'qbs')
-rw-r--r-- | qbs/imports/QtcAutotest.qbs | 24 | ||||
-rw-r--r-- | qbs/imports/QtcLibrary.qbs | 22 | ||||
-rw-r--r-- | qbs/imports/QtcPlugin.qbs | 24 | ||||
-rw-r--r-- | qbs/imports/QtcProduct.qbs | 26 | ||||
-rw-r--r-- | qbs/imports/QtcTool.qbs | 24 |
5 files changed, 53 insertions, 67 deletions
diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs index 6f07f61bb9..fb6ea09d7e 100644 --- a/qbs/imports/QtcAutotest.qbs +++ b/qbs/imports/QtcAutotest.qbs @@ -1,8 +1,8 @@ import qbs import qbs.FileInfo -import QtcFunctions +import QtcProduct -CppApplication { +QtcProduct { type: "application" Depends { name: "Qt.test" } targetName: "tst_" + name.split(' ').join("") @@ -11,8 +11,6 @@ CppApplication { destinationDirectory: buildDirectory + '/' + FileInfo.relativePath(project.ide_source_tree, sourceDirectory) - cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) - cpp.linkerFlags: QtcFunctions.commonLinkerFlags(qbs) cpp.rpaths: [ buildDirectory + '/' + project.ide_library_path, buildDirectory + '/' + project.ide_library_path + "/..", // OSX @@ -20,16 +18,16 @@ CppApplication { ] cpp.minimumOsxVersion: "10.7" + Group { + fileTagsFilter: product.type + qbs.install: false + } + // The following would be conceptually right, but does not work currently as some autotests // (e.g. extensionsystem) do not work when installed, because they want hardcoded // absolute paths to resources in the build directory. -// cpp.rpaths: qbs.targetOS.contains("osx") -// ? ["@executable_path/.."] -// : ["$ORIGIN/../" + project.libDirName + "/qtcreator", -// "$ORIGIN/../" project.libDirName + "/qtcreator/plugins"] -// Group { -// fileTagsFilter: product.type -// qbs.install: true -// qbs.installDir: project.ide_bin_path -// } + // cpp.rpaths: qbs.targetOS.contains("osx") + // ? ["@executable_path/.."] + // : ["$ORIGIN/../" + project.libDirName + "/qtcreator", + // "$ORIGIN/../" project.libDirName + "/qtcreator/plugins"] } diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs index 55d5490384..75b395a1c2 100644 --- a/qbs/imports/QtcLibrary.qbs +++ b/qbs/imports/QtcLibrary.qbs @@ -1,8 +1,10 @@ import qbs 1.0 import QtcFunctions +import QtcProduct -DynamicLibrary { - Depends { name: "cpp" } +QtcProduct { + type: "dynamiclibrary" + installDir: project.ide_library_path Depends { condition: project.testsEnabled name: "Qt.test" @@ -11,13 +13,9 @@ DynamicLibrary { targetName: QtcFunctions.qtLibraryName(qbs, name) destinationDirectory: project.ide_library_path - cpp.defines: project.generalDefines - cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) cpp.linkerFlags: { - var flags = QtcFunctions.commonLinkerFlags(qbs); - if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) - flags.push("-Wl,-s"); - else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) + var flags = base; + if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb return flags; } @@ -27,17 +25,9 @@ DynamicLibrary { : ["$ORIGIN", "$ORIGIN/.."] property string libIncludeBase: ".." // #include <lib/header.h> cpp.includePaths: [libIncludeBase] - cpp.minimumOsxVersion: "10.7" - cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2" Export { Depends { name: "cpp" } cpp.includePaths: [libIncludeBase] } - - Group { - fileTagsFilter: product.type - qbs.install: true - qbs.installDir: project.ide_library_path - } } diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs index 3d0d7471a4..14d8f909fe 100644 --- a/qbs/imports/QtcPlugin.qbs +++ b/qbs/imports/QtcPlugin.qbs @@ -1,13 +1,15 @@ import qbs 1.0 import qbs.FileInfo import QtcFunctions +import QtcProduct -Product { +QtcProduct { type: ["dynamiclibrary", "pluginSpec"] + installDir: project.ide_plugin_path + property var pluginspecreplacements property var pluginRecommends: [] - Depends { name: "Qt.core" } property string minimumQtVersion: "4.8" condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion) @@ -16,30 +18,24 @@ Product { Depends { name: "ExtensionSystem" } Depends { name: "pluginspec" } - Depends { name: "cpp" } Depends { condition: project.testsEnabled name: "Qt.test" } - cpp.defines: project.generalDefines.concat([name.toUpperCase() + "_LIBRARY"]) + cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"]) cpp.installNamePrefix: "@rpath/PlugIns/" cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/..", "@executable_path/.."] : ["$ORIGIN", "$ORIGIN/.."] - cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) cpp.linkerFlags: { - var flags = QtcFunctions.commonLinkerFlags(qbs); - if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) - flags.push("-Wl,-s"); - else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) + var flags = base; + if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb return flags; } property string pluginIncludeBase: ".." // #include <plugin/header.h> cpp.includePaths: [pluginIncludeBase] - cpp.minimumOsxVersion: "10.7" - cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2" Group { name: "PluginSpec" @@ -52,12 +48,6 @@ Product { files: [ "*.mimetypes.xml" ] } - Group { - fileTagsFilter: product.type - qbs.install: true - qbs.installDir: project.ide_plugin_path - } - Export { Depends { name: "ExtensionSystem" } Depends { name: "cpp" } diff --git a/qbs/imports/QtcProduct.qbs b/qbs/imports/QtcProduct.qbs new file mode 100644 index 0000000000..a0433de4ef --- /dev/null +++ b/qbs/imports/QtcProduct.qbs @@ -0,0 +1,26 @@ +import qbs 1.0 +import QtcFunctions + +Product { + property string installDir + + Depends { name: "cpp" } + cpp.defines: project.generalDefines + cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) + cpp.linkerFlags: { + var flags = QtcFunctions.commonLinkerFlags(qbs); + if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) + flags.push("-Wl,-s"); + return flags; + } + cpp.minimumOsxVersion: "10.7" + cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2" + + Depends { name: "Qt.core" } + + Group { + fileTagsFilter: product.type + qbs.install: true + qbs.installDir: installDir + } +} diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs index 34d5bf45a5..3581662f39 100644 --- a/qbs/imports/QtcTool.qbs +++ b/qbs/imports/QtcTool.qbs @@ -1,29 +1,11 @@ import qbs 1.0 -import QtcFunctions +import QtcProduct -Application { +QtcProduct { type: "application" // no Mac app bundle - Depends { name: "cpp" } - cpp.defines: project.generalDefines - cpp.cxxFlags: QtcFunctions.commonCxxFlags(qbs) - cpp.linkerFlags: { - var flags = QtcFunctions.commonLinkerFlags(qbs); - if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) - flags.push("-Wl,-s"); - return flags; - } - - property string toolInstallDir: project.ide_libexec_path + installDir: project.ide_libexec_path cpp.rpaths: qbs.targetOS.contains("osx") ? ["@executable_path/../" + project.ide_library_path] : ["$ORIGIN/../" + project.ide_library_path] - cpp.minimumOsxVersion: "10.7" - cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2" - - Group { - fileTagsFilter: product.type - qbs.install: true - qbs.installDir: toolInstallDir - } } |