KiKi
KiKi

Reputation: 535

The right way to use a custom library in Qt?

I have a custom library to be included in Qt. Currently, it is included by adding the followings in .pro file.

INCLUDEPATH += ...
DEPENDPATH += ...
LIB += ...

Since the library is used in most of my projects. I am wondering that if there is some way to make my custom library to be INTEGRATED with the QtSDK? Maybe it can be included by syntax like the build-in components

QT += my_custom_library

and everything (header file include path, lib file include, etc...) will be done.

Is the integration possible?

Upvotes: 3

Views: 909

Answers (1)

Tatu Lahtela
Tatu Lahtela

Reputation: 4554

You are probably looking for to create a mkspec file which then used with CONFIG option. So create a file to $QT_HOME/mkspec/features/mycoollib.prf that contains your instructions. There should be plenty of examples in that directory. The name of the file declares it's usage, so the file mycoollib.prf would be used like:

CONFIG += mycoollib

Upvotes: 4

Related Questions