Difference between revisions of "Building Plugins:HelloMyth"
(→Creating Your First Plugin: Hello Myth) |
(→Creating Your First Plugin: Hello Myth) |
||
Line 7: | Line 7: | ||
To start, download the mythplugin directory from [http://svn.mythtv.org/trac/ SVN]. Now create the following directory tree within the mythplugin directory: | To start, download the mythplugin directory from [http://svn.mythtv.org/trac/ SVN]. Now create the following directory tree within the mythplugin directory: | ||
− | |||
<pre> | <pre> | ||
mythplugin/ | mythplugin/ | ||
Line 13: | Line 12: | ||
mythhello/ | mythhello/ | ||
</pre> | </pre> | ||
− | |||
=== mythhello.pro Files === | === mythhello.pro Files === | ||
Line 20: | Line 18: | ||
1) Create a file called mythhello.pro in the first mythhello directory: | 1) Create a file called mythhello.pro in the first mythhello directory: | ||
− | |||
<pre> | <pre> | ||
TEMPLATE = subdirs | TEMPLATE = subdirs | ||
Line 27: | Line 24: | ||
SUBDIRS = <strong>mythhello</strong> | SUBDIRS = <strong>mythhello</strong> | ||
</pre> | </pre> | ||
− | |||
"mythhello" refers to the second mythhello directory. | "mythhello" refers to the second mythhello directory. | ||
2) Create another file called mythhello.pro in the second mythhello directory | 2) Create another file called mythhello.pro in the second mythhello directory | ||
− | |||
<pre> | <pre> | ||
include ( ../../mythconfig.mak ) | include ( ../../mythconfig.mak ) | ||
Line 39: | Line 34: | ||
TEMPLATE = lib | TEMPLATE = lib | ||
CONFIG += plugin thread | CONFIG += plugin thread | ||
− | TARGET = | + | TARGET = mythhello |
target.path = $${LIBDIR}/mythtv/plugins | target.path = $${LIBDIR}/mythtv/plugins | ||
INSTALLS += target | INSTALLS += target | ||
uifiles.path = $${PREFIX}/share/mythtv/themes/default | uifiles.path = $${PREFIX}/share/mythtv/themes/default | ||
− | uifiles.files = | + | uifiles.files = hello-ui.xml |
installfiles.path = $${PREFIX}/share/mythtv | installfiles.path = $${PREFIX}/share/mythtv | ||
− | installfiles.files = | + | installfiles.files = hello-ui.xml |
INSTALLS += uifiles | INSTALLS += uifiles | ||
# Input | # Input | ||
− | HEADERS += | + | HEADERS += mythhello.h |
− | SOURCES += | + | SOURCES += main.cpp mythhello.cpp |
macx { | macx { | ||
Line 58: | Line 53: | ||
} | } | ||
</pre> | </pre> | ||
− | |||
− | + | ||
− | + | The following items are specific to your plugin: uifiles.files, installfiles.files, HEADERS, SOURCES. 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> | <pre> | ||
PREFIX=/usr/ | PREFIX=/usr/ | ||
LIBDIR=/usr/lib/ | LIBDIR=/usr/lib/ | ||
</pre> | </pre> | ||
− |
Revision as of 04:54, 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:
mythplugin/ mythhello/ mythhello/
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:
TEMPLATE = subdirs # Directories SUBDIRS = <strong>mythhello</strong>
"mythhello" refers to the second mythhello directory.
2) Create another file called mythhello.pro in the second mythhello directory
include ( ../../mythconfig.mak ) include ( ../../settings.pro ) TEMPLATE = lib CONFIG += plugin thread TARGET = mythhello target.path = $${LIBDIR}/mythtv/plugins INSTALLS += target uifiles.path = $${PREFIX}/share/mythtv/themes/default uifiles.files = hello-ui.xml installfiles.path = $${PREFIX}/share/mythtv installfiles.files = hello-ui.xml INSTALLS += uifiles # Input HEADERS += mythhello.h SOURCES += main.cpp mythhello.cpp macx { QMAKE_LFLAGS += -flat_namespace -undefined suppress }
The following items are specific to your plugin: uifiles.files, installfiles.files, HEADERS, SOURCES. 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:
PREFIX=/usr/ LIBDIR=/usr/lib/