Is is necessary to use the Qt toolchain (pro files, qmake, etc...) in order to link against a library that was implemented and built with Qt, but itself exposes only a C style API? None of the Qt specific classes are used in the library.
The question applies to both static and dynamic libraries.
Is is necessary to use the Qt tools in order to link against a library that was implemented with Qt.
Absolutely not.
The Qt tools that generate code are moc
and rcc
; if your API doesn't use this then it is quite possible just to use normal 'C' tools.
moc is a tool for signals and slots and even C++ code doesn't need to use the Qt tools to link against a Qt library. You can scan a 'header' for the MOC macro with grep, etc in a make rule to know if the moc
program should be run on the executable. Following a convention that class.cc has a declaration in class.h makes this easy.
rcc is a feature that bundle resources with an application. However this would be for the Qt application/library and in your case, you just want to link with it.
So, it is even possible to make Qt applications/libraries without qmake
, etc. However, your makefile will need to fulfil all the portability issues that qmake
, etc do or you may not care about this.
There are trade-offs to not using the Qt tools. However, a large majority of Qt features can be used without the tools.