[QBS] Set custom compilation flag

Thomas Epting thomas.epting.stryker at gmail.com
Mon Mar 21 16:23:48 CET 2016


Define the property in your project, e.g. like this

Project {

    name: "Tests"

    property bool noTests: true

    condition: noTests === false

    references: [

        "ParserTest/ParserTest.qbs",

        "ValentinaTest/ValentinaTest.qbs"

    ]

}


On the command line, set it via project.<propertyName>:<value>

qbs build project.noTests:false ...

BR, Thomas


2016-03-21 14:33 GMT+01:00 dismine <dismine at gmail.com>:

> Hi.
>
> Thanks, i missed this option in the documentation. But still i can't make
> the same.
>
>    - How to set a custom property in build command?
>    - What about default value for a custom property? I don't want to
>    always set a property in build command.
>
> I made this:
>
> Project {
>
>     name: "Tests"
>
>     condition: noTests === false
>
>     references: [
>
>         "ParserTest/ParserTest.qbs",
>
>         "ValentinaTest/ValentinaTest.qbs"
>
>     ]
>
> }
>
>
> But qbs doesn't see *noTests* from build command. I run like this
> *noTests:false.*
>
> Sorry for stupid questions, but i can't find answer myself.
>
> On Fri, Mar 18, 2016 at 3:47 PM, Slyshyk Oleksiy <alexslyshyk at gmail.com>
> wrote:
>
>> Hi.
>> You can set properties for a project directly in build command. Help:
>> http://doc.qt.io/qbs/building-applications.html
>>
>> 2016-03-18 12:09 GMT+02:00 dismine <dismine at gmail.com>:
>>
>>> Hi,
>>>
>>> When i use qmake i can run it, in some cases, like this:
>>>
>>> qmake PREFIX=%{_prefix} Valentina.pro -r "CONFIG += noTests noRunPath
>>> no_ccache noDebugSymbols"
>>>
>>> But i can't find information how to pass such custom keys to qbs.
>>>
>>> Thanks,
>>> Roman
>>>
>>> _______________________________________________
>>> QBS mailing list
>>> QBS at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/qbs
>>>
>>>
>>
>> _______________________________________________
>> QBS mailing list
>> QBS at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qbs
>>
>>
>
> _______________________________________________
> QBS mailing list
> QBS at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20160321/d09e4ee1/attachment.html>


More information about the Qbs mailing list