BasicPlugin

Module defining the function basic_plugin() to generate a generic plugin module.

basic_plugin

Create a plugin library, with or without a separate registration library to avoid One Definition Rule (ODR) violations.

Synopsis
basic_plugin(<name> <suffix> [<options>])
Source specification options
IMPL_SOURCE <implementation-source>... Specify source to

compile into the plugin’s interface implementation library, if appropriate. The implementation should not invoke any registration definition macros or the ODR will be violated.

REG_SOURCE <registration-source>...

Specify source to compile into the plugin registration library, intended only for runtime injection (via e.g. dlopen()) into an executable, and not for dynamic linking.

Note

  • If REG_SOURCE is omitted, we look for <name>_<suffix>.cc

  • If IMPL_SOURCE is omitted, we look for <name>.cc

Dependency specification options

LIBRARIES [INTERFACE|PRIVATE|PROTECTED|PUBLIC|REG] <library-dependency>...

Specify targets and/or libraries upon which the implementation (INTERFACE, PUBLIC, PRIVATE), or registration (REG) libraries should depend. If implementation and registration share a dependency not inherited by public callers of the implementation, specify the library as both PRIVATE and REG.

Note

  • The registration library has an automatic dependence on the implementation library (if present).

  • If PUBLIC or INTERFACE dependencies are specified and there is no implementation source, then the library will be built shared rather than as a module, and all responsibility for ODR violations rests with the library builder.

  • An additional dependency designation, CONDITIONAL, is accepted and is intended for use by intermediate functions adding dependencies to a library. CONDITIONAL is identical to PUBLIC without making a statement about the shared or module nature of the combined implementation/registration library or the presence of a public (non-plugin) calling interface.

Other options
ALIAS <alias>...

Create the specified CMake alias targets to the implementation library.

ALLOW_UNDERSCORES

Normally, neither <name> nor <suffix> may contain underscores in order to avoid possible ambiguities. Allow them with this option at your own risk.

BASENAME_ONLY

Do not add the relative path (directories delimited by _) to the front of the plugin library name.

EXPORT_SET <export-name>

Add the library to the <export-name> export set.

LOCAL_INCLUDE_DIRS <dir>...

Headers may be found in <dir>… at build time.

NOP

Option / argument disambiguator; no other function.

NO_EXPORT

NO_INSTALL

Do not install the generated library or libraries.

SOVERSION <version>

The library’s compatibility version (cf SOVERSION).

USE_BOOST_UNIT

The plugin uses Boost unit test functions and should be compiled and linked accordingly.

USE_PACKAGE_NAME

The package name will be prepended to the plugin library name, separated by _

VERSION

The library’s build version will be set to CETMODULES_CURRENT_PROJECT_NAME (cf VERSION).

Deprecated options
SOURCE <source>...

Specify sources to compile into the plugin.

Deprecated since version 2.11: use IMPL_SOURCE, REG_SOURCE and LIBRARIES REG instead.

USE_PRODUCT_NAME

Deprecated since version 2.0: use USE_PACKAGE_NAME instead.

Non-option arguments
<name>

The name stem for the library to be generated.

<suffix>

The category of plugin to be generated.

See also

cet_make_library()