[QBS] How to use linking dependences of the third-party libraries

Christian Kandeler christian.kandeler at digia.com
Wed May 28 12:14:29 CEST 2014


On 05/28/2014 11:59 AM, Denis Shienkov wrote:
> Christian,
>
>  >So you want a kind of pseudo-product (or module, perhaps?) that acts as
> a wrapper around some existing binary?
>
> Yes, exactly.
>
>  > In that case, couldn't you just
> create a Transformer that does nothing except specifying the artifact?
>
> Does not work, a linker do not receive a name of library (of my wrapper)
> in process of linking of application...
>
> == ext_qbs.qbs ==
>
> Project{
>
>      references:  [
>
>          "hasp/hasp.qbs",
>
>          "app/app.qbs",
>
>      ]
>
> }
>
>
> == ext_qbs\app\app.qbs ==
>
> Application{
>
>      name:  "app"
>
>      Depends  {  name:  "cpp"  }
>
>      Depends  {  name:  "hasp_windows_88149"  }
>
>      files:  [  "app.cpp"  ]
>
> }
>
> == ext_qbs\hasp\hasp.qbs ==
>
>
> DynamicLibrary{
>
>      name:  "hasp_windows_88149"
>
>      files:  [  "hasp_api.h"  ]
>
>      Transformer  {
>
>          Artifact  {
>
>              fileName:  "hasp_windows_88149.dll"
>
>              fileTags:  "dynamiclibrary"
>
>          }

I think you also need to add the .lib file here with the file tag 
"dynamiclibrary_import".


Christian


>
>          prepare:  {
>
>              var  cmd  =  new  JavaScriptCommand();
>
>              cmd.silent  =  true;
>
>              cmd.source  =  function()  {  };
>
>              return  cmd;
>
>          }
>
>      }
>
>      Export  {
>
>          Depends  {  name:  "cpp"  }
>
>          cpp.includePaths:  "."
>
>      }
>
> }
>
> where "ext_qbs\hasp\" contains an two binary file:
> - hasp_windows_88149.dll
> - hasp_windows_88149.lib
>
> I don't understand, why the "hasp_windows_88149" do not exports implicity of cpp.dynamicLibraries property?
>
> But if I do it explicity:
>
>
>      Export  {
>          Depends  {  name:  "cpp"  }
>          cpp.includePaths:  "."
>          cpp.dynamicLibraries:  path  +  "/"  +  targetName
>      }
>
> then all linked fine.. But this hardcode is ugly, IMHO..




More information about the Qbs mailing list