Difference between revisions of "Building Plugins:HelloMyth"
(→Creating Your First Plugin: Hello Myth) |
(→Creating Your First Plugin: Hello Myth) |
||
Line 1: | Line 1: | ||
− | |||
== Creating Your First Plugin: Hello Myth == | == Creating Your First Plugin: Hello Myth == | ||
Revision as of 04:53, 22 January 2007
Creating Your First Plugin: Hello Myth
This is a really simple skeleton plugin that doesn't do anything. It'll show you what is absolutely necessary to create a plugin. Then you can expand on that by disecting others.
As a disclaimer, I am also very new to plugin development and so please correct me where I might be wrong.
To start, download the mythplugin directory from SVN. Now create the following directory tree within the mythplugin directory:
<pre> mythplugin/ mythhello/ mythhello/ </pre>
mythhello.pro Files
The *.pro files are used by qmake to create the Makefiles.
1) Create a file called mythhello.pro in the first mythhello directory: <pre> TEMPLATE = subdirs # Directories SUBDIRS = <strong>mythhello</strong> </pre>
"mythhello" refers to the second mythhello directory.
2) Create another file called mythhello.pro in the second mythhello directory <pre> include ( ../../mythconfig.mak ) include ( ../../settings.pro ) TEMPLATE = lib CONFIG += plugin thread TARGET = <b>mythhello</b> target.path = $${LIBDIR}/mythtv/plugins INSTALLS += target uifiles.path = $${PREFIX}/share/mythtv/themes/default uifiles.files = <b>hello-ui.xml</b> installfiles.path = $${PREFIX}/share/mythtv installfiles.files = <b>hello-ui.xml</b> INSTALLS += uifiles # Input HEADERS += <b>mythhello.h</b> SOURCES += <b>main.cpp mythhello.cpp</b> macx { QMAKE_LFLAGS += -flat_namespace -undefined suppress } </pre>
All things in bold are specific to your plugin. Be sure that $${LIBDIR} and $${PREFIX} are set in mythplugins/mythconfig.mak to be the mythtv install prefix and library directory. Mine are set to: <pre> PREFIX=/usr/ LIBDIR=/usr/lib/ </pre>