Skip to content

v0.4 Build instructions

Hugues Delorme edited this page May 15, 2017 · 5 revisions

Supported compilers

Tested compilers are GCC, MinGW, Clang and Visual C++.
Required minimal version of Visual C++ is 2013 because of C99 support.

Using CMake

gmio build system is CMake ≥ v2.8

Example of cmake invokation:

    cmake -G "Unix Makefiles" \
          /opt/lib/gmio       \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_INSTALL_PREFIX=/opt/build/gmio

This will configure building of gmio using default values for main options.

If you chose "makefiles" CMake generator (as in the example above), once configured then type:

    (n)make
    (n)make install

The CMake configuration (through cmake-gui for example) has several options specific to gmio :

Option Description Default
GMIO_BUILD_DLL Build also a shared library(DLL) if ON ON
GMIO_USE_BUNDLED_ZLIB Use bundled version of zlib1 ON
GMIO_FLOAT2STR_LIB Name of the library for float-to-string conversions 2 std
GMIO_STR2FLOAT_LIB Name of the library for string-to-float conversions 3 irrlicht_fast_atof

1 zlib :
If OFF then set cmake variable ZLIB_ROOT to a zlib installation root.
This tells FindZLIB() where to look

2 Values :
std: C standard library functions(eg snprintf())
google_doubleconversion: Google's double-conversion functions, note that this implies C++
fastness: std < google_doubleconversion
robustness: google_doubleconversionstd

3 Values :
std: C standard library functions(eg strtod())
irrlicht_fast_atof: fast_atof() function of the Irrlicht project
google_doubleconversion: Google's double-conversion functions, note that this implies C++
fastness: std < google_doubleconversion < irrlicht_fast_atof
robustness: irrlicht_fast_atof < google_doubleconversionstd

Although use of CMake is encouraged, it can be easily replaced by other build systems. Just take care to create a config.h header within the gmio_core folder (see config.h.cmake for the definitions to be set).

Run unit tests

After having successfully built gmio, you should run unit tests to see if gmio works fine (especially if you plan to use it on not so common compilers, OS, ...).
To run unit tests, just type (n)make check
This will produce text output for each test. If everything goes fine you should see the last lines :

    100% tests passed, 0 tests failed out of X
    Total Test time (real) =   ...

Note on gmio_support

gmio_support is the bridge between gmio and other 3rd-party libraries (eg. OpenCascade, Qt, ...), allowing seamless integration. Nonetheless, to avoid the gmio library being dependent of some other binaries, compilation of gmio_support is left to the developer.
For example if Qt streams are needed then the target project must build somehow gmio_support/stream_qt.cpp
All gmio_support source files are copied with install target (ie by doing (n)make install) to PREFIX/src/gmio_support

Generate HTML reference manual

When using the "makefiles" CMake generator then the doc target is available, so just type:

    (n)make doc

and this will produce the HTML reference manual in $BUILD_DIR/doc/html.
Note that Doxygen is required for that step.

You can’t perform that action at this time.