CMT Packages

From Daya Bay
Jump to navigation Jump to search

We organize our software into units called "packages" that are organized with CMT

Types of packages

We use several types of packages, including:

these hold source code to build applications and/or libraries.
these hold CMT configuration to "glue" in external, 3rd party packages.
these provide rules telling CMT how to build software or how to setup the environment for running the software

Anatomy of a package

The contents of a package are all held in a directory named after the package:


In this directory are one or more subdirectories. What subdirectories exist depends on what the package is supposed to be used for. A sample of required or optional subdirectories follows


The only truly required subdirectory is


And this requires the file:


The requirements file describes the package to CMT.

Because we do not used versioned subdirectories, you will also need a file:


which holds the version of the package, for example "v0" or "v1r2p3".

Other files will be placed in cmt/ as CMT configures or builds the package.


All source code (and private header) files your package may have go in


Creating a new package

First go to a directory where you want the package to sit. It is recommended that you organize your packages into one or more CMT Projects.

cd ~work/dayabay/projects/project1

New package by hand

mkdir -p PackageName/cmt
echo "v0" > PackageName/cmt/version.cmt
cat <<EOF > PackageName/cmt/requirements
package PackageName
version v0
branches cmt

This is minimal, see CMT requirements file for more information.