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?
Asked
Active
Viewed 57 times
1 Answers
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