Is there are any mechanism in qmake like cmake's find_package
?
If I need to include library installed on my system, how can I avoid to write include path and library names manually? What is the best practice?
If the used library provides pkgconfig .pc file, you can use link_pkgconfig in your .pro file as:
CONFIG += link_pkgconfig
PKGCONFIG += quazip
If the library provides a command line utility to get the compiler flags (like postgresql does), then you can call it and assign add output to the corresponding variabla
INCLUDEPATH += $$system(pg_config --includedir)
If the library itself was written in Qt as well, unlikely, but possible that it provides a Qt module, like qwt does for instance. In this case you can just add to your .pro file:
CONFIG += qwt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With