[QBS] Why condition doesn't work?

Loaden loaden at gmail.com
Wed Jun 20 15:53:24 CEST 2012


I have to change the qbs file like below:

> import qbs.base 1.0
>
> import "../QtcPlugin.qbs" as QtcPlugin
>
> QtcPlugin {
>     name: "Help"
>
>     Depends { id: qtcore; name: "Qt.core" }
> *    Depends {
>         condition: qtcore.versionMajor == 4
>         name: "Qt"; submodules: ["widgets", "help", "webkit", "network"]
>     }
>     Depends {
>         condition: qtcore.versionMajor >= 5
>         name: "Qt"; submodules: ["widgets", "help", "network",
> "printsupport"]
>     }
> *
>     Depends { name: "Core" }
>     Depends { name: "Find" }
>     Depends { name: "Locator" }
>
>     Depends { name: "cpp" }
> *    Properties {
>         condition: qtcore.versionMajor >= 5
>         cpp.defines: base.concat(["QT_NO_WEBKIT"])
>     }*
>     cpp.defines: base.concat([
>         "QT_CLUCENE_SUPPORT",
>         "HELP_LIBRARY"
>     ])
>     cpp.includePaths: [
>         "../../shared/help",
>         ".",
>         "..",
>         "../..",
>         "../../libs",
>         buildDirectory
>     ]
>

2012/6/20 Loaden <loaden at gmail.com>

> 1. Why the red condition doesn't work?
> 2. How to debug qbs script? e.g. print some debug information?
>
>
>> import qbs.base 1.0
>>
>> import "../QtcPlugin.qbs" as QtcPlugin
>>
>> QtcPlugin {
>>     name: "Help"
>>
>>     Depends { name: "cpp" }
>>     Depends { id: qtcore; name: "Qt.core" }
>>
>> *    if (qtcore.versionMajor == 4) {
>>         Depends { name: "Qt"; submodules: ["widgets", "help", "webkit",
>> "network"] }
>>     } else {
>>         Depends { name: "Qt"; submodules: ["widgets", "help", "network",
>> "printsupport"] }
>>         cpp.defines: base.concat(["QT_NO_WEBKIT"])
>>     }*
>>
>>     Depends { name: "Core" }
>>     Depends { name: "Find" }
>>     Depends { name: "Locator" }
>>
>>     cpp.defines: base.concat([
>>         "QT_CLUCENE_SUPPORT",
>>         "HELP_LIBRARY"
>>     ])
>>     cpp.includePaths: [
>>         "../../shared/help",
>>         ".",
>>         "..",
>>         "../..",
>>         "../../libs",
>>         buildDirectory
>>     ]
>>
>>
> --
> Please don't ask where I come from, It's a shame!
> Best Regards
> Yuchen
>
>


-- 
Please don't ask where I come from, It's a shame!
Best Regards
Yuchen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20120620/dcc78138/attachment.html>


More information about the Qbs mailing list