0

I have a project that should use postgresql c-library (libpq) and project is configured. How I can configure QBS module to import all required headers and libs into project?

Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
Roman Volkov
  • 245
  • 1
  • 4
  • 12

1 Answers1

0

I found solution:

import qbs 1.0

Product {
   name: "PostgresqlConnector"
   type: "dynamiclibrary"

   Depends {name:"cpp"}
   Depends { name: "Qt.core" }
   Depends { name: "UniversalDataObjects" }

   property string rootPath: "/Users/romanvolkov/Desktop/postgresql-9.6.0/src/"
   cpp.includePaths: [rootPath + "/include/",
       rootPath + "/interfaces/ecpg/pgtypeslib/",
       rootPath + "interfaces/libpq/"]
   cpp.dynamicLibraries: [rootPath + "interfaces/libpq/" + "libpq.dylib"]

   files: [
       "postgresqlconnectioninfo.cpp",
       "postgresqlconnectioninfo.h",
   ]
}

You just have to import cpp dependency, set cpp.includePaths with libpg srcs, pgtypes header and include files set cpp.dynamicLibraries with name of dynamic lib (by default library compiled as dynamic lib via make)

Roman Volkov
  • 245
  • 1
  • 4
  • 12