update qbs files

Use the new contains function and the targetOS list.

Change-Id: I38b995eb9328e449befad85792512c45670cc8c9
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
Joerg Bornemann
2013-06-20 14:43:33 +02:00
parent 84a597e411
commit cd37aef6cf
19 changed files with 60 additions and 55 deletions

View File

@@ -6,7 +6,7 @@ Product {
Group {
name: "Resources"
qbs.install: true
qbs.installDir: (qbs.targetOS == "windows" ? "lib/qtcreator" : project.ide_library_path)
qbs.installDir: (qbs.targetOS.contains("windows") ? "lib/qtcreator" : project.ide_library_path)
+ "/qtcomponents"
files: [
"*.qml",

View File

@@ -8,31 +8,35 @@ Project {
property string ide_version_minor: '7'
property string ide_version_release: '83'
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
property string ide_app_path: qbs.targetOS == "mac" ? "" : "bin"
property string ide_app_target: qbs.targetOS == "mac" ? "Qt Creator" : "qtcreator"
property string ide_app_path: qbs.targetOS.contains("mac") ? "" : "bin"
property string ide_app_target: qbs.targetOS.contains("mac") ? "Qt Creator" : "qtcreator"
property string ide_library_path: {
if (qbs.targetOS == "mac")
if (qbs.targetOS.contains("mac"))
return ide_app_target + ".app/Contents/PlugIns"
else if (qbs.targetOS == "windows")
else if (qbs.targetOS.contains("windows"))
return ide_app_path
else
return "lib/qtcreator"
}
property string ide_plugin_path: {
if (qbs.targetOS == "mac")
if (qbs.targetOS.contains("mac"))
return ide_library_path
else if (qbs.targetOS == "windows")
else if (qbs.targetOS.contains("windows"))
return "lib/qtcreator/plugins"
else
return ide_library_path + "/plugins"
}
property string ide_data_path: qbs.targetOS == "mac" ? ide_app_target + ".app/Contents/Resources"
property string ide_data_path: qbs.targetOS.contains("mac")
? ide_app_target + ".app/Contents/Resources"
: "share/qtcreator"
property string ide_libexec_path: qbs.targetOS == "mac" ? ide_data_path
property string ide_libexec_path: qbs.targetOS.contains("mac")
? ide_data_path
: ide_app_path
property string ide_doc_path: qbs.targetOS == "mac" ? ide_data_path + "/doc"
property string ide_doc_path: qbs.targetOS.contains("mac")
? ide_data_path + "/doc"
: "share/doc/qtcreator"
property string ide_bin_path: qbs.targetOS == "mac" ? ide_app_target + ".app/Contents/MacOS"
property string ide_bin_path: qbs.targetOS.contains("mac")
? ide_app_target + ".app/Contents/MacOS"
: ide_app_path
moduleSearchPaths: "qbs"
@@ -170,7 +174,7 @@ Project {
name: project.ide_app_target
consoleApplication: qbs.debugInformation
cpp.rpaths: qbs.targetOS == "mac" ? ["@executable_path/.."]
cpp.rpaths: qbs.targetOS.contains("mac") ? ["@executable_path/.."]
: ["$ORIGIN/../lib/qtcreator"]
cpp.defines: Defaults.defines(qbs)
cpp.linkerFlags: {
@@ -205,7 +209,7 @@ Project {
Group {
name: "qtcreator.sh"
condition: qbs.targetPlatform.indexOf("unix") != -1 && qbs.targetOS != "mac"
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("mac")
files: "bin/qtcreator.sh"
qbs.install: true
qbs.installDir: "bin"
@@ -213,7 +217,7 @@ Project {
Group {
name: "QtLockedFile_unix"
condition: qbs.targetPlatform.indexOf("unix") != -1
condition: qbs.targetOS.contains("unix")
files: [
"src/shared/qtlockedfile/qtlockedfile_unix.cpp"
]
@@ -221,7 +225,7 @@ Project {
Group {
name: "QtLockedFile_win"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
files: [
"src/shared/qtlockedfile/qtlockedfile_win.cpp"
]

View File

@@ -14,7 +14,8 @@ DynamicLibrary {
return ["-Wl,-s"]
}
cpp.installNamePrefix: "@rpath/PlugIns/"
cpp.rpaths: qbs.targetOS == "mac" ? ["@loader_path/..", "@executable_path/.."]
cpp.rpaths: qbs.targetOS.contains("mac")
? ["@loader_path/..", "@executable_path/.."]
: ["$ORIGIN", "$ORIGIN/.."]
cpp.includePaths: [ ".", ".." ]

View File

@@ -54,13 +54,13 @@ QtcLibrary {
var result = [];
if (useSystemBotan)
result.push("botan-1.10")
if (qbs.targetOS === "windows")
if (qbs.targetOS.contains("windows"))
result.push("advapi32", "user32")
else if (qbs.targetOS === "linux")
else if (qbs.targetOS.contains("linux"))
result.push("rt", "dl");
else if (qbs.targetOS === "mac")
else if (qbs.targetOS.contains("mac"))
result.push("dl");
else if (qbs.targetPlatform.indexOf("unix") !== -1)
else if (qbs.targetOS.contains("unix"))
result.push("rt");
return result
}
@@ -74,7 +74,7 @@ QtcLibrary {
result.push("BOTAN_BUILD_COMPILER_IS_MSVC", "BOTAN_TARGET_OS_HAS_GMTIME_S")
if (qbs.toolchain === "gcc" || qbs.toolchain === "mingw")
result.push("BOTAN_BUILD_COMPILER_IS_GCC")
if (qbs.targetOS === "linux")
if (qbs.targetOS.contains("linux"))
result.push("BOTAN_TARGET_OS_IS_LINUX", "BOTAN_TARGET_OS_HAS_CLOCK_GETTIME",
"BOTAN_TARGET_OS_HAS_DLOPEN", " BOTAN_TARGET_OS_HAS_GMTIME_R",
"BOTAN_TARGET_OS_HAS_POSIX_MLOCK", "BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE",
@@ -82,12 +82,12 @@ QtcLibrary {
"BOTAN_HAS_ALLOC_MMAP", "BOTAN_HAS_ENTROPY_SRC_DEV_RANDOM",
"BOTAN_HAS_ENTROPY_SRC_EGD", "BOTAN_HAS_ENTROPY_SRC_FTW",
"BOTAN_HAS_ENTROPY_SRC_UNIX", "BOTAN_HAS_MUTEX_PTHREAD", "BOTAN_HAS_PIPE_UNIXFD_IO")
if (qbs.targetOS === "mac")
if (qbs.targetOS.contains("mac"))
result.push("BOTAN_TARGET_OS_IS_DARWIN", "BOTAN_TARGET_OS_HAS_GETTIMEOFDAY",
"BOTAN_HAS_ALLOC_MMAP", "BOTAN_HAS_ENTROPY_SRC_DEV_RANDOM",
"BOTAN_HAS_ENTROPY_SRC_EGD", "BOTAN_HAS_ENTROPY_SRC_FTW",
"BOTAN_HAS_ENTROPY_SRC_UNIX", "BOTAN_HAS_MUTEX_PTHREAD", "BOTAN_HAS_PIPE_UNIXFD_IO")
if (qbs.targetOS === "windows")
if (qbs.targetOS.contains("windows"))
result.push("BOTAN_TARGET_OS_IS_WINDOWS",
"BOTAN_TARGET_OS_HAS_LOADLIBRARY", "BOTAN_TARGET_OS_HAS_WIN32_GET_SYSTEMTIME",
"BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK", "BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE",

View File

@@ -4,7 +4,7 @@ import "../../tools/QtcTool.qbs" as QtcTool
QtcTool {
name: "qtcreator_ctrlc_stub"
consoleApplication: true
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
files: [ "process_ctrlc_stub.cpp" ]

View File

@@ -7,7 +7,7 @@ QtcTool {
files: {
if (qbs.targetOS == "windows") {
if (qbs.targetOS.contains("windows")) {
return [ "process_stub_win.c" ]
} else {
return [ "process_stub_unix.c" ]
@@ -15,7 +15,7 @@ QtcTool {
}
cpp.dynamicLibraries: {
if (qbs.targetOS == "windows") {
if (qbs.targetOS.contains("windows")) {
return [ "shell32" ]
}
}

View File

@@ -7,7 +7,7 @@ QtcLibrary {
cpp.defines: base.concat("QTCREATOR_UTILS_LIB")
Properties {
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
cpp.dynamicLibraries: [
"user32",
"iphlpapi",
@@ -15,7 +15,7 @@ QtcLibrary {
]
}
Properties {
condition: qbs.targetPlatform.indexOf("unix") != -1 && qbs.targetOS != "mac"
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("mac")
cpp.dynamicLibraries: ["X11"]
}
@@ -197,7 +197,7 @@ QtcLibrary {
Group {
name: "WindowsUtils"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
files: [
"consoleprocess_win.cpp",
"winutils.cpp",
@@ -207,7 +207,7 @@ QtcLibrary {
Group {
name: "ConsoleProcess_unix"
condition: qbs.targetPlatform.indexOf("unix") != -1
condition: qbs.targetOS.contains("unix")
files: [
"consoleprocess_unix.cpp",
]

View File

@@ -10,7 +10,7 @@ QtcLibrary {
cpp.defines: {
var list = base;
list.push("ZEROCONF_LIBRARY");
if (qbs.targetOS === "linux") {
if (qbs.targetOS.contains("linux")) {
list.push(
"_GNU_SOURCE",
"HAVE_IPV6",
@@ -23,7 +23,7 @@ QtcLibrary {
}
Properties {
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
cpp.dynamicLibraries: "ws2_32"
}

View File

@@ -30,7 +30,7 @@ Product {
cpp.defines: Defaults.defines(qbs).concat([name.toUpperCase() + "_LIBRARY"])
cpp.installNamePrefix: "@rpath/PlugIns/" + provider + "/"
cpp.rpaths: qbs.targetOS == "mac" ? ["@loader_path/../..", "@executable_path/.."]
cpp.rpaths: qbs.targetOS.contains("mac") ? ["@loader_path/../..", "@executable_path/.."]
: ["$ORIGIN", "$ORIGIN/..", "$ORIGIN/../.."]
cpp.linkerFlags: {
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw"))

View File

@@ -6,7 +6,7 @@ QtcPlugin {
name: "ClearCase"
// provider: "AudioCodes"
condition: qbs.targetOS != "mac"
condition: !qbs.targetOS.contains("mac")
Depends { name: "Qt.widgets" }
Depends { name: "Core" }

View File

@@ -25,13 +25,13 @@ QtcPlugin {
])
cpp.dynamicLibraries: {
if (qbs.targetOS == "windows") return [
if (qbs.targetOS.contains("windows")) return [
"ole32",
"user32"
]
}
cpp.frameworks: qbs.targetOS === "mac" ? ["AppKit"] : undefined
cpp.frameworks: qbs.targetOS.contains("mac") ? ["AppKit"] : undefined
files: [
"basefilewizard.cpp",
@@ -233,7 +233,7 @@ QtcPlugin {
Group {
name: "ProgressManager_win"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
files: [
"progressmanager/progressmanager_win.cpp",
]
@@ -241,7 +241,7 @@ QtcPlugin {
Group {
name: "ProgressManager_mac"
condition: qbs.targetOS == "mac"
condition: qbs.targetOS.contains("mac")
files: [
"macfullscreen.h",
"macfullscreen.mm",
@@ -251,7 +251,7 @@ QtcPlugin {
Group {
name: "ProgressManager_x11"
condition: qbs.targetPlatform.indexOf("unix") != -1 && qbs.targetOS != "mac"
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("mac")
files: [
"progressmanager/progressmanager_x11.cpp",
]

View File

@@ -1,7 +1,7 @@
import qbs.base 1.0
Product {
condition: qbs.targetOS == "linux"
condition: qbs.targetOS.contains("linux")
name: "LogoImages"
Group {

View File

@@ -268,7 +268,7 @@ QtcPlugin {
Group {
name: "RegistryAccess"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
prefix: "../../shared/registryaccess/"
files: [
"registryaccess.cpp",
@@ -278,7 +278,7 @@ QtcPlugin {
Group {
name: "RegisterPostMortem"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
files: [
"registerpostmortemaction.cpp",
"registerpostmortemaction.h",
@@ -287,7 +287,7 @@ QtcPlugin {
Group {
name: "LLDBOptions"
condition: qbs.targetOS == "mac"
condition: qbs.targetOS.contains("mac")
files: [
"lldblib/lldboptionspage.cpp",
"lldblib/lldboptionspage.h",
@@ -296,7 +296,7 @@ QtcPlugin {
}
Properties {
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
cpp.dynamicLibraries: [
"advapi32",
"ole32",

View File

@@ -3,7 +3,7 @@ import "../../libs/QtcLibrary.qbs" as QtcLibrary
QtcLibrary {
name: "ptracepreload"
condition: qbs.targetOS == "linux"
condition: qbs.targetOS.contains("linux")
cpp.dynamicLibraries: [
"dl",

View File

@@ -334,7 +334,7 @@ QtcPlugin {
Group {
name: "WindowsToolChains"
condition: qbs.targetOS == "windows" || Defaults.testsEnabled(qbs)
condition: qbs.targetOS.contains("windows") || Defaults.testsEnabled(qbs)
files: [
"abstractmsvctoolchain.cpp",
"abstractmsvctoolchain.h",

View File

@@ -35,7 +35,7 @@ QtcPlugin {
cpp.rpaths: base.concat([qbs_build_dir + "/lib"])
cpp.dynamicLibraries: {
var libs = []
if (qbs.targetOS === "windows") {
if (qbs.targetOS.contains("windows")) {
libs.push("shell32")
if (qbs.enableDebugCode)
libs.push("qbscored")

View File

@@ -3,7 +3,7 @@ import "../QtcTool.qbs" as QtcTool
QtcTool {
name: "qtcdebugger"
condition: qbs.targetOS == "windows"
condition: qbs.targetOS.contains("windows")
cpp.includePaths: [
buildDirectory,

View File

@@ -3,7 +3,7 @@ import "../QtcTool.qbs" as QtcTool
QtcTool {
name: "qtcreator_crash_handler"
condition: qbs.targetOS == "linux" && qbs.buildVariant == "debug"
condition: qbs.targetOS.contains("linux") && qbs.buildVariant == "debug"
cpp.includePaths: [
buildDirectory,

View File

@@ -9,7 +9,7 @@ QtcTool {
Depends { name: "app_version_header" }
cpp.includePaths: "../../libs"
cpp.defines: base.concat([qbs.targetOS === "mac"
cpp.defines: base.concat([qbs.targetOS.contains("mac")
? 'DATA_PATH="."' : 'DATA_PATH="../share/qtcreator"'])
files: [