From c8881e7ca2fc7249b5c88e7c485913f0df7a7c05 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 27 Feb 2014 18:18:54 +0100 Subject: [PATCH] Support configurable library location in qbs build. And also in the qbs sub-project (for the qbs and qmake builds). This becomes possible with the qbs submodule update that is part of this patch. Change-Id: I8347a8c04a52bcb0682f32d808fb61a90ef3ba72 Reviewed-by: Joerg Bornemann --- qtcreator.pro | 5 +++-- qtcreator.qbs | 7 ++++--- src/app/app.qbs | 2 +- src/plugins/cpaster/frontend/frontend.qbs | 6 +++--- src/plugins/qbsprojectmanager/qbsproject.cpp | 2 +- src/shared/qbs | 2 +- src/src.qbs | 2 +- tests/auto/autotest.qbs | 3 ++- tests/auto/extensionsystem/plugin.qbs | 4 ++-- 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/qtcreator.pro b/qtcreator.pro index 1e250446d5e..cc0c0db48bf 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -43,8 +43,9 @@ exists(src/shared/qbs/qbs.pro) { system("echo QBS_LIB_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache") system("echo QBS_RESOURCES_BUILD_DIR = $${maybe_backslash}\"$${IDE_DATA_PATH}/qbs$${maybe_backslash}\" >> $$qmake_cache") system("echo QBS_RESOURCES_INSTALL_DIR = $${QTC_PREFIX}/share/qtcreator/qbs >> $$qmake_cache") - system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_BUILD_TREE}/lib/qtcreator/$${maybe_backslash}\" >> $$qmake_cache") - system("echo QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/lib/qtcreator >> $$qmake_cache") + system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_BUILD_TREE}/$${IDE_LIBRARY_BASENAME}/qtcreator/$${maybe_backslash}\" >> $$qmake_cache") + system("echo QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache") + system("echo QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME} >> $$qmake_cache") system("echo CONFIG += qbs_no_dev_install >> $$qmake_cache") } diff --git a/qtcreator.qbs b/qtcreator.qbs index 6228a1b53d6..638faa134c9 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -16,19 +16,20 @@ Project { property pathList additionalPlugins: [] property pathList additionalLibs: [] property pathList additionalTools: [] + property string libDirName: "lib" property string ide_library_path: { if (qbs.targetOS.contains("osx")) return ide_app_target + ".app/Contents/PlugIns" else if (qbs.targetOS.contains("windows")) return ide_app_path else - return "lib/qtcreator" + return libDirName + "/qtcreator" } property string ide_plugin_path: { if (qbs.targetOS.contains("osx")) return ide_library_path else if (qbs.targetOS.contains("windows")) - return "lib/qtcreator/plugins" + return libDirName + "/qtcreator/plugins" else return ide_library_path + "/plugins" } @@ -47,7 +48,7 @@ Project { property bool testsEnabled: qbs.getenv("TEST") || qbs.buildVariant === "debug" property stringList generalDefines: [ "QT_CREATOR", - 'IDE_LIBRARY_BASENAME="lib"', + 'IDE_LIBRARY_BASENAME="' + libDirName + '"', "QT_DISABLE_DEPRECATED_BEFORE=0x040900", "QT_NO_CAST_TO_ASCII", "QT_NO_CAST_FROM_ASCII" diff --git a/src/app/app.qbs b/src/app/app.qbs index aebc44643ee..844536ab13b 100644 --- a/src/app/app.qbs +++ b/src/app/app.qbs @@ -5,7 +5,7 @@ Application { consoleApplication: qbs.debugInformation cpp.rpaths: qbs.targetOS.contains("osx") ? ["@executable_path/.."] - : ["$ORIGIN/../lib/qtcreator"] + : ["$ORIGIN/../" + project.libDirName + "/qtcreator"] cpp.defines: project.generalDefines cpp.linkerFlags: { if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) diff --git a/src/plugins/cpaster/frontend/frontend.qbs b/src/plugins/cpaster/frontend/frontend.qbs index ba7d8a378be..e425a88560c 100644 --- a/src/plugins/cpaster/frontend/frontend.qbs +++ b/src/plugins/cpaster/frontend/frontend.qbs @@ -12,9 +12,9 @@ QtcTool { Depends { name: "CppTools" } cpp.rpaths: [ - "$ORIGIN/../lib/qtcreator", - "$ORIGIN/../lib/qtcreator/plugins", - "$ORIGIN/../lib/qtcreator/plugins/QtProject" + "$ORIGIN/../" + project.libDirName + "/qtcreator", + "$ORIGIN/../" + project.libDirName + "/qtcreator/plugins", + "$ORIGIN/../" + project.libDirName + "/qtcreator/plugins/QtProject" ] Group { diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index f1b43da8ac7..a9c2b3fe26d 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -727,7 +727,7 @@ QString QbsProject::pluginsBaseDirectory() const if (!qbsInstallDir.isEmpty()) return qbsInstallDir + QLatin1String("/lib/"); return QDir::cleanPath(QCoreApplication::applicationDirPath() - + QLatin1String("/../lib/qtcreator")); + + QLatin1String("/../" IDE_LIBRARY_BASENAME "/qtcreator")); } } // namespace Internal diff --git a/src/shared/qbs b/src/shared/qbs index 0816b8e476d..3e746e47415 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 0816b8e476d20e00cbcffd1e71162adf93e85658 +Subproject commit 3e746e4741513dabf60f43efab938d8fc94cd1be diff --git a/src/src.qbs b/src/src.qbs index d7ba55a39a5..bca1658abf6 100644 --- a/src/src.qbs +++ b/src/src.qbs @@ -27,7 +27,7 @@ Project { property path libRPaths: qbs.targetOS.contains("osx") ? ["@loader_path/.."] : ["$ORIGIN/.."] property path resourcesInstallDir: project.ide_data_path + "/qbs" - property string pluginsInstallDir: "lib/qtcreator" + property string pluginsInstallDir: project.libDirName + "/qtcreator" references: [ qbsBaseDir + "/src/lib/libs.qbs", diff --git a/tests/auto/autotest.qbs b/tests/auto/autotest.qbs index 9625b10b295..fb4985a765d 100644 --- a/tests/auto/autotest.qbs +++ b/tests/auto/autotest.qbs @@ -21,7 +21,8 @@ CppApplication { // absolute paths to resources in the build directory. // cpp.rpaths: qbs.targetOS.contains("osx") // ? ["@executable_path/.."] -// : ["$ORIGIN/../lib/qtcreator", "$ORIGIN/../lib/qtcreator/plugins/QtProject"] +// : ["$ORIGIN/../" + project.libDirName + "/qtcreator", +// "$ORIGIN/../" project.libDirName + "/qtcreator/plugins/QtProject"] // Group { // fileTagsFilter: product.type // qbs.install: true diff --git a/tests/auto/extensionsystem/plugin.qbs b/tests/auto/extensionsystem/plugin.qbs index 829ed3a6de9..c6ccbe75669 100644 --- a/tests/auto/extensionsystem/plugin.qbs +++ b/tests/auto/extensionsystem/plugin.qbs @@ -11,8 +11,8 @@ DynamicLibrary { targetName: QtcFunctions.qtLibraryName(qbs, name.split('_')[1]) destinationDirectory: FileInfo.relativePath(project.ide_source_tree, sourceDirectory) cpp.rpaths: [ - buildDirectory + "/lib/qtcreator", - buildDirectory + "/lib/qtcreator/plugins/QtProject" + buildDirectory + "/" + project.libDirName + "/qtcreator", + buildDirectory + "/" + project.libDirName + "/qtcreator/plugins/QtProject" ].concat(additionalRPaths) property pathList filesToCopy property pathList additionalRPaths: []