When ones creates a plug-in for Code::Blocks (focusing here on contrib plug-ins that should work under Windows and linux), the plug-in project will contain several files :
1) Source files
2) Project files (*.cbp, Makefile.am's ..)
3) manifest file
4) resource files
This causes the plug-in name (or it's ID, or whatever you like to call it) to show up in several places.
The majority of those places require that name to be identical, meaning using the same case !! [On windows this is no issue, but on linux it is very important].
Let's have a look at those places where that name shows up.
But first let's decide on a name for our test case plug-in : "TestCase".
This would be the *suggestion* : start every word in the name with an uppercase : JustLikeThis
Allrighty, let's continue our excursion :
1) manifest.xml
--> it states the plug-in name
2) the zip file of the resources : "TestCase.zip"
This zip file is created as a post-build step, so the correct command needs to show up in the following project files :
TestCase.cbp (to build on windows with CB)
TestCase-unix.cbp (to build on linux with CB)
Makefile.am : to build on linux and windows
Some example snippets out of those project files :
<ExtraCommands>
<Add after="zip -j9 ..\..\..\devel\share\codeblocks\TestCase.zip resources\manifest.xml resources\*.xrc" />
<Mode after="always" />
</ExtraCommands>
<ExtraCommands>
<Add after="zip -j9 ../../../devel/share/codeblocks/TestCase.zip resources/manifest.xml resources/*.xrc" />
<Mode after="always" />
</ExtraCommands>
EXTRA_DIST = MyFirst.xrc MySecond.xrc manifest.xml
pkgdata_DATA = TestCase.zip
CLEANFILES = $(pkgdata_DATA)
TestCase.zip:
PWD=`pwd` cd $(srcdir) && zip $(PWD)/TestCase.zip manifest.xml *.xrc > /dev/null
3) The code registering the plug-in and loading the resource :
TestCase.cpp :
// Register the plugin
namespace
{
PluginRegistrant<TestCase> reg(_T("TestCase"));
};
/* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */
TestCase::TestCase()
{
//ctor
if(!Manager::LoadResource(_T("TestCase.zip")))
{
NotifyMissingFile(_T("TestCase.zip"));
}
}// end of constructor
4) the output "shared" library (*.so or *.dll)
Again some example snippets from the project files
<Option output="..\..\..\devel\share\CodeBlocks\plugins\TestCase.dll" prefix_auto="0" extension_auto="0" />
<Option output="../../../devel/share/codeblocks/plugins/libTestCase.so" />
lib_LTLIBRARIES = libSymTab.la
libTestCase_la_LDFLAGS = -module -version-info 0:1:0 -shared -no-undefined -avoid-version
libTestCase_la_LIBADD =
libTestCase_la_SOURCES =
And for consistency it's also nice if you project names are alike :
<Project>
<Option title="TestCase" />