Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Getting Started

Miguel Martin edited this page Jun 28, 2014 · 5 revisions

Dependencies

To compile, install, and use anax, the following libraries and C++ support is required:

Building the Library

To install and build the library, you can use CMake or your own method of installation. However, it is recommended that you do use CMake.

To build using CMake, use the following commands:

mkdir build
cd build
cmake ..
sudo make install

Where the directory build can be anything you wish, it just contains all temporary files CMake creates.

NOTES:

  1. This will be different to Windows, as instead of using sudo you just have to run the command line as an administrator.
  2. For Windows, you may also have to use the Visual Studio command line in order for it to build. This is just a simple way to install/build the library, you can use the GUI of CMake, pass arguments to cmake or use the CMake command line tool (ccmake) if you wish.
  3. If you generate project files then you will obviously not be able to make

The build options can be more customized, using the GUI of CMake, command line tool (ccmake), or by passing arguments to cmake. To change a variable in CMake through an argument, use the following syntax:

-D<variable-name>=<value>

Where <variable-name> is the name of the variable and <value> is the value you wish to set it. You may also want to take note of the CMAKE_BUILD_TYPE variable, it is a string, which is by default "Debug".

Here are the available variables for the library's build:

variable description
ANAX_32_BIT_ENTITY_IDS A boolean to determine if you wish to use 32 bit entity IDs instead of 64 bits (OFF by default)
ANAX_USE_VARIADIC_TEMPLATES A boolean to determine whether or not to enable the use of variadic templates where appropriate in the library (ON by default)
ANAX_VIRTUAL_DTORS_IN_COMPONENT A boolean to determine whether or not to have virtual destructors within each component (ON by default)
BUILD_SHARED_LIBS A boolean to represent whether to build shared libs (ON by default)
BUILD_TESTS* A boolean to determine if you wish to build tests or not (OFF by default)
Boost_DIR A string that contains the file path to your boost library (note: this is found automatically for you)

*To run the tests, simply use the following command(s):

make test

Including the library

To include the core of the library, please just use the following line:

#include <anax/anax.hpp>

All classes are located in the anax namespace. If you require a part of the library, but not all of it, you may do so. For example, when defining a component type in a separate class, you should #include <anax/Component.hpp>.

NOTE:

Do not include any header files from the detail directory, unless you specifically know what you're doing. There is no need to explicitly #include anything from it.