Creating your plugins
The SDK was painless to create. We can now proceed to create our first plugin. We already know that all our plugins will include the SDK we just completed. Fortunately, this can be easily factorized in a .pri
file (PRoject Include). A .pri
file behaves exactly like a .pro
file; the only difference is that it is intended to be included inside .pro
files.
In the ch08-image-animation
directory, create a file named plugins-common.pri
that contains the following code:
INCLUDEPATH += $$PWD/sdk DEPENDPATH += $$PWD/sdk
This file will be included in each .pro
plugin. It aims to tell the compiler where it can find the headers of the SDK and where to look to resolve dependencies between headers and sources. This will enhance the modification detection and properly compile the sources when needed.
To see this file in the project, we have to add it to the OTHER_FILES
macro in ch08-image-animation.pro
:
OTHER_FILES += \ sdk/Filter.h \ plugins-common.pri
The...