X4 Module Management: Default Tags

Overview

X4 uses tags to annotate modules. Some of these tags provide vital information, such as dependencies of projects. This file gives an overview of standard tags that are commonly used.

Standard Tags

By convention, tags are written in CAPS (tags are not case sensitive).

These are the tags for modules. They are added in a file "ModuleName.mod.cpp" in the main directory of the module (along with the vcproj file). The following macro is available for setting module tags:

BEGIN_INIT_MODULE
...code executed after class registration...
END_INIT_MODULE

BEGIN_SHUTDOWN_MODULE
...code executed before class deregistration...
END_SHUTDOWN_MODULE

BEGIN_X4_MODULE(moduleName)
...tag list...
END_X4_MODULE

The first two blocks create code that is exceuted after class registration and before shutdown. Afterwards, the main module declaration follows: BEGIN_X4_MODULE/END_X4_MODULE. These macros start and end, respectively, the declaration of module properties. "moduleName" must be the name of the module. In between, zero or more of the following macros can be used:

TAG_MODULE("TAGNAME", "value")

"TAGNAME" is the name of the tag, "value" is the string associated with the tag. Values are added to the list of tags (appended at the end of the list).

Tag name Usage
DEPENDENCIES    Mandatory: List of module names that this module depends on (such as: moduleManagement, objects)
If no dependencies are specified, it is assumed that the module does not need any additional modules to run.
DEPENDENCIES_BUILD Mandatory: List of additional modules that this module depends on at compile-time but not at run-time because
these modules do not create code (such as: basics, qtlibs)
DEPRECATED - VS 2010 has this build in
LICENSE License for the source files in this module. Standard is "GPL V2" and "GPL V3"
AUTHORS List of authors who contributed to this module
INSTITUTION Institutions who hold the copyright for this module
ICON The value of this tag contains a QT resource string pointing to an icon for this module.
CLASSES A list of string tags in the format "ClassA inherits ClassB".
This information is used to automatically generate code that registers and unregisters classes provided by this module.
MODULE_TYPE This tag should be either "LOADABLE_MODULE" or "APPLICATION".
It indicates what the intended output is (dll or exe).

Standard tags can be abbreviated as follows:

ADD_DEPENDENCY(moduleName)       // adds a dependency

ADD_DEPENDENCY_BUILD(moduleName) // adds a dependency to a module that does not create loadable executable code (such as "basics")

ADD_LICENSE(string)              // adds a license the user can choose from

ADD_AUTHOR(string)               // adds an author

ADD_INSTITUITION(string)         // adds an institution

ADD_ICON(QImage)                 // adds an icon to the module

ADD_CLASS(class, parentClass)    // declares a new class

SET_MODULE_TYPE_LOADABLE_MODULE  // this is a loabable module

SET_MODULE_TYPE_APPLICATION      // this is a loabable module