Clarisse 5.0 SP8 SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
cmagen and CMA

Table of Contents

If you wish to write your custom C++ modules to extend Clarisse, you must be familiar with both CID and CMA concepts. This topic introduces you to cmagen a special tool dedicated to generate CMA files.

What are CMA files?

A CMA file, which stands for Class Module Accessor, (pronounced c-ma) contains all the C++ bindings needed to declare a custom OfClass in Clarisse. This file, simplifies the creation of modules and is automatically generated by cmagen from an input CID file defining a new OfClass.


Provided with the SDK, cmagen is a tool that generates CMA files from an input CID file which declares a new OfClass. Note that attributes of base classes, when available, are automatically inherited by the new class.

For more information on cmagen usage please type in the command line

cmagen help

The generated C++ code is stored in a new file named after the input CID file followed by the extension CMA. This file which generates all C++ bindings related to the new OfClass must then be included in your C++ file defining your module. For more information please refer to Module declaration

Setting module paths

In order to work properly cmagen needs to locate where all your Clarisse modules. Indeed, your new OfClass is likely to inherit from another class which cmagen must be able to find its definition. You must provide the path to modules defining the base class (and the full hierarchy) of your new OfClass. To do so you just have to use -module_path argument which sets the location of your modules. For example:

cmagen my_custom_class.cid -module_path /path/to/your/modules

You also may have decided to place your modules in different folders. This is why cmagen supports multiple module_path locations. To specify multiple module paths you simply have to separate each path with a space such as:

cmagen my_custom_class.cid -module_path /path/to/your/modules /path/to/other/modules

CID inclusion path

CID syntax supports #include directive in order to simplify the writing CID file. You can either directly specify the file path of the CID file you wish to include such as #include "path/to/cid/file" or specify to cmagen as a command line argument using -search_path. For example:

cmagen my_custom_class.cid -search_path /path/to/your/cid/files

You can also specify multiple paths by separating each path using the space character such as:

cmagen my_custom_class.cid -search_path /path/to/your/cid/files /path/to/others/cid/files