开发者

The right way to use a custom library in Qt?

开发者 https://www.devze.com 2023-03-20 01:00 出处:网络
I have a custom library to be included in Qt. Currently, it is included by adding the followings in .pro file.

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 开发者_JAVA百科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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消