CopperSpice Overview  1.5.1
Deploying Plugins

This section explains how to deploy plugins your CopperSpice applications will load at runtime.

Plugin Directory

Your application executable directory is referred to as the pluginsbase. As an example, if your Windows application is located in "C:\Program Files\MyApp" and has a style plugin, CopperSpice will look in "C:\Program Files\MyApp\styles" for the plugin. CopperSpice will also look in the directory specified by QLibraryInfo::location(QLibraryInfo::PluginsPath).

If CopperSpice should look in additional directories, use QCoreApplication::addLibraryPath(). To set your own path, use QCoreApplication::setLibraryPaths().

The cs.conf file can also be used to override the hard coded paths compiled into the CopperSpice library. For more information about the conf file refer to the Path Configuration documentation.

Another possibility is to set the QT_PLUGIN_PATH environment variable before running your application. If set, CS will look for plugins in the paths (separated by the system path separator) specified in the variable.

Loading and Verifying Plugins

When loading plugins the CS library does some minimal checking to determine whether or not the plugin can be loaded and used. This provides the ability to have multiple versions and configurations of the CS library installed.

  • Plugins linked with a CS library that has a higher version number will not be loaded by a library with a lower version number
  • Plugins linked with a CS library that has a lower major version number will not be loaded by a library with a higher major version number

When building plugins it is important to ensure that the plugin is configured the same way as your application. This means if the application was built in release mode, the plugin should also be built in release mode.