Project

General

Profile

Art cmake modules

art_make

Identify the files in the current source directory and build libraries, dictionaries and plugins as appropriate.

####################################
# NOTES:
#
# Users may opt to just include art_make() in their CMakeLists.txt This
# implementation is intended to be called NO MORE THAN ONCE per
# subdirectory.
#
# * art_make() tries very hard to be intelligent, but it doesn't fit
# every need. In which case, you might need to call art_make_library(),
# art_make_exec(), art_make_test(), art_dictionary()
# (art/Modules/ArtDictionary.cmake) and/or simple_plugin()
# (art/Modules/BuildPlugins.cmake) separately.
#
# * If art_make() doesn't quite fit your needs (different plugins of the
# same type have different library dependencies, for example), you can
# use art_make() with a suitable EXCLUDE option to do everything except
# your special case and then deal with it separately.
#
# * art_make() will not take care of the installation of headers into an
# installed product's include/ directory tree, or of files into the
# products source/ area. See install_headers() and install_source() in
# cetbuildtools/Modules/InstallSource.cmake.
#
# * art_make() knows about ROOT dictionaries (as signalled by the
# presence of classes.h and classes_def.xml), and the following plugin
# types:
#
#   * modules -- producers, filters, analyzers and outputs (*_module.cc)
#   * services (*_service.cc)
#   * sources (*_source.cc)
#
#  You may specify a plugin-type-specific library link list as
#  XXXX_LIBRARIES. If you have another plugin type (fleeble, say), you
#  may make its existence known to art_make() by specifying a (possibly
#  empty) FLEEBLE_LIBRARIES argument. Source files matching,
#  "*_fleeble.cc' will be identified by that command as being plugins of
#  type, "fleeble" and use FLEEBLE_LIBRARIES against which to link.
#
####################################

USAGE:

art_make( [LIBRARY_NAME <library name>]
          [LIB_LIBRARIES <library list>]
          [MODULE_LIBRARIES <library list>]
          [SOURCE_LIBRARIES <library list>]
          [SERVICE_LIBRARIES <library list>]
          [DICT_LIBRARIES <library list>]
          [SUBDIRS <source subdirectory>] (e.g., detail)
          [EXCLUDE <ignore these files>]
          [WITH_STATIC_LIBRARY]
          [BASENAME_ONLY] (passed to simple_plugin)
          [NO_PLUGINS]
        )

  • In art_make(), LIBRARIES has been REMOVED! use LIB_LIBRARIES instead.
  • If NONE of {MODULES,SOURCE,SERVICE,DICT}_LIBRARIES is specified, then LIB_LIBRARIES (or LIBRARIES) will be used as appropriate for plugins as appropriate.
  • If ANY of the above are specified then libraries must be specified for every plugin type or dictionary encountered.

art_make_library

art_make_library( [LIBRARY_NAME <library name>]  
                  SOURCE <source code list>
                  [LIBRARIES <library list>] 
                  [WITH_STATIC_LIBRARY]
                  [NO_INSTALL]
                  [LIBRARY_NAME_VAR <var_name>] )
  • If LIBRARY_NAME_VAR is specified, then that variable will be set to contain the final name of the library.

art_make_exec

art_make_exec( NAME <executable name>  
               [SOURCE <source code list>] 
               [LIBRARIES <library link list>]
               [USE_BOOST_UNIT]
               [NO_INSTALL] )

art_make_test

art_make_test( NAME <executable name>
               [SOURCE <source code list>]
               [LIBRARIES <library link list>]
               [USE_BOOST_UNIT]
               [INSTALL|NO_INSTALL]
               [NO_AUTO] )

art_dictionary

An art specific front end for build_dictionary

simple_plugin

macro for building plugin libraries

The plugin type is expected to be service, source, or module, but we do not actively enforce this.

USAGE:

simple_plugin( <name> <plugin type>
               [library list]
               [USE_BOOST_UNIT]
               [ALLOW_UNDERSCORES]
               [BASENAME_ONLY]
               [NO_INSTALL]
  )

The plugin library's name is constructed from the specified name, its specified plugin type (eg service, module, source), and (unless BASENAME_ONLY is specified) the package subdirectory path (by replacing "/" with "_").

Options:
  • ALLOW_UNDERSCORES
  • Allow underscores in subdirectory names.
  • Discouraged, as it createsa possible ambiguity in the encoded plugin library name (art_test/XX is indistinguishable from art/test/XX).
  • BASENAME_ONLY
  • Omit the subdirectory path from the library name.
  • Discouraged, as it creates an ambiguity between modules with the same source filename in different packages or different subdirectories within the same package. The latter case is not possible however, because CMake will throw an error because the two CMake targets will have the same name and that is not permitted.
  • NO_INSTALL
  • If specified, the plugin library will not be part of the installed product (use for test modules, etc.).
  • USE_BOOST_UNIT