[QBS] How to get path informations
Mathieu Bouchard
mbouchar at gmail.com
Sun Feb 19 04:12:49 CET 2012
Just found out that I was supposed to use Properties instead of Groups. But
appending librairies to cpp.dynamicLibraries still doesn't work. I think I
should wait for the official documentation to be ready! :)
On Sat, Feb 18, 2012 at 5:11 PM, Mathieu Bouchard <mbouchar at gmail.com>wrote:
> Hi again,
>
> I figured out it was localPath. This fixed my include problem. Now I have
> another problem with the cpp module. I want to do something like:
> Application {
> Depends { name: "cpp" }
> Depends { name: "Qt.core" }
> property bool sharedSsl: true
> cpp.includePaths: [
> "C:/OpenSSL/outinc"
> ]
> cpp.libraryPaths: ["C:/OpenSSL/out"]
> Group {
> condition: sharedSsl == true
> cpp.dynamicLibraries: ["eay32", "ssl32"]
> }
> Group {
> condition: sharedSsl == false
> cpp.dynamicLibraries: ["crypto", "ssl"]
> }
> }
> And then:
> import "cryptapp.qbs" as CryptApplication
> CryptApplication {
> name: "cryptui"
> Depends { name: "Qt.gui" }
> cpp.dynamicLibraries: ["gdi32"]
> Group {
> files: [
> "main.cpp",
> "cryptui.ui"
> ]
> }
> }
>
> But I think I don't understand how inheritance should work, because only
> gdi32 is included in the final linkage. If I remote the gdi32 line, the
> other libraries are not used. If I don't put them in a Group, then they are
> used, but if I uncomment the gdi32 line, only the gdi32 library is used.
>
> Can we put cpp.dynamicLibraries in a Group? And how can I append libraries
> informations from multiple files?
>
> Thanks again
>
> On Sat, Feb 18, 2012 at 2:04 PM, Mathieu Bouchard <mbouchar at gmail.com>wrote:
>
>> Hi,
>>
>> I'm really interested about replacing my existing qmake code with qbs,
>> so I'm trying to port one of my projects to it. But I hit a dead end.
>>
>> The project consist of multiple binaries that use some common
>> informations. For example, the qmake project could be abstracted as:
>> =========================>
>> myproject/
>> myproject/myproject.pro
>> myproject/myproject.pri
>> myproject/include
>> myproject/src/console/console.pro
>> myproject/src/console/main.cpp
>> myproject/src/ui/ui.pro
>> myproject/src/ui/main.cpp
>> In the .pri file, I have:
>> INCLUDEPATH += $$PWD/include
>> <=========================
>>
>> I tried to achieve that with the following structure:
>> =========================>
>> myproject/
>> myproject/myproject.qbp
>> myproject/myproject.qbs
>> myproject/include
>> myproject/src/console/console.qbs
>> myproject/src/console/main.cpp
>> myproject/src/ui/ui.qbs
>> myproject/src/ui/main.cpp
>> <=========================
>>
>> The main myproject.qbp file is:
>> =========================>
>> import qbs.base 1.0
>> Project {
>> references: [
>> "src/console/console.qbs",
>> "src/ui/ui.qbs"
>> ]
>> }
>> <=========================
>>
>> The src/*/*.qbs have:
>> =========================>
>> import qbs.base 1.0
>> import "../../../myproject.qbs" as CommonApplication
>> CommonApplication {
>> name: "console"
>> files: ["main.cpp"]
>> }
>> <=========================
>>
>> And finally, the myproject.qbs:
>> =========================>
>> import qbs.base 1.0
>> Application {
>> Depends { name: "cpp" }
>> Depends { name: "Qt.core" }
>> cpp.includePaths: [
>> "include"
>> ]
>> files: [
>> "src/backends/api.cpp",
>> ]
>> }
>> <=========================
>>
>> The problem is that the included directory is relative to the included
>> .qbs file (eg: for console.qbs, this is
>> -IC:/[...]/myproject/src/console/include) instead of
>> -IC:/[...]/myproject/include. I'm probably doing something wrong here, but
>> I don't know how to solve it, even after looking into all the examples and
>> the QtCreator patch. I even looked into the code-source of qbs, looking at
>> something relevant, but found nothing of interest.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20120218/e7a11297/attachment.html>
More information about the Qbs
mailing list