This page lists guidelines on packages and package build systems. These are not hard requirements (packages that do not follow these guidelines could be integrated in Rock), but are meant to be followed when possible.

A template package that is following these guidelines can be generated using the rock-create-lib tool

rock-create-lib path/to/mypackage

Where the package name is then the basename of the path (here "mypackage")

Package Directories

The only mandatory files and directories are and src/. The other ones are optional.

  • doxyfile configuration file
  • src/: Contains all header (*.h/*.hpp) and source files, as well as the pkg-config file(s) for the built libraries.
  • viz/: Source files for a vizkit plugin / widget related to this library
  • bindings/: Bindings for this package for other language, e.g. such as Ruby
    • ruby/: Ruby files and C++-to-Ruby extensions related to this package.
  • resources/: General resources such as images that are needed by the program
  • build/:The target directory for the build process, temporary content. This directory is automatically created by the build system(s)
  • external/: When including software that needs a non standard installation process, or one that can be easily embedded include the external software directly here
  • doc/: should contain additional documentation

Code Naming Conventions

  • class names are UpperCamelCase
  • method names are lowerCamelCase
  • namespaces are snake_case

File naming

  • there should be one header and one source file per class
  • the source file should be named ClassName.cpp, the header ClassName.hpp
  • as an exception, when a number of small data structures are defined by the package, they can be defined in a <PackageName>Types.hpp file. Do NOT use Types.hpp as it is going to collide with orogen's use of this file name.

Build System Behaviour

  • the build system must support separating the build from the source (i.e. building in a build/ subdirectory)
  • the package must have a "make install" target which installs the relevant binaries and headers in a specified prefix (CMAKE_INSTALL_PREFIX when using CMake). The installation should follow the Linux directory standard.
  • the package should have a "make doc" target which generates documentation for the API in build/doc.
  • headers should be installed in a subdirectory of include/ named as the package (for instance, the slam/envire package should install its includes in include/envire/). As a special exception, packages that have a single include file can install it as include/<package_name>.hpp
Last modified 9 years ago Last modified on 07/09/13 10:55:36