On Jul 13, 2016, at 10:54 PM, YangRong 
<[email protected]<mailto:[email protected]>> wrote:

Hello,

I have two questions about qbs:
1. Anyone knows how to reuse a property string?

You can't reference properties like that (referring to your extended detail on 
http://stackoverflow.com/questions/38365877/qbs-qestion-about-library-relative-path-and-how-to-reuse-a-property-string).
 You'll need to use QML inheritance or import a JavaScript file. For example, 
you can put JS code into separate .js files and then import them.

    ---helpers.js---
    function planetsCorrectlyAligned()
    {
        // implementation
    }

    ---myproject.qbs---
    import qbs 1.0
    import "helpers.js" as Helpers

    Product {
        name: "myproject"
        Group {
            condition: Helpers.planetsCorrectlyAligned()
            file: "magic_hack.cpp"
        }
        // ...
    }

This syntax for this is detailed in the Qbs documentation at: 
https://doc.qt.io/qbs/language-introduction.html#reusing-project-file-code


2. I can not use a relative path in the cpp.dynamicLibraries nor 
cpp.staticLibraries. Do I have to use absolute path there?

Didn't I answer this question elsewhere?

for more details: I created a StackOverflow question:
http://stackoverflow.com/questions/38365877/qbs-qestion-about-library-relative-path-and-how-to-reuse-a-property-string

Thanks for your help


r0nG

Auckland, New Zealand
_______________________________________________
QBS mailing list
[email protected]<mailto:[email protected]>
http://lists.qt-project.org/mailman/listinfo/qbs

--
Jake Petroules - [email protected]<mailto:[email protected]>
Consulting Services Engineer - The Qt Company
Qbs build tool evangelist - qbs.io<http://qbs.io>

_______________________________________________
QBS mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs

Reply via email to