How to Build

December 16, 2025 ยท View on GitHub

This project uses CMake cross-platform build system to generate required build files native to the platform.

Available CMake Options

Please open major CMakeLists.txt for the complete list of available options and other input parameters.

Choosing C++ Standard

Since CMake v3.1 it became possible to set version of C++ standard by setting CMAKE_CXX_STANDARD variable. If no value of this variable is set in command line arguments, default value 11 will be assigned to it. In order to use c++14 standard in compilation, set the variable value to 14.

Please NOTE, that clang compiler may have problems compiling valid c++11 constructs used in this project. Usage of C++14 may fix the problem.

Build and Install Examples

The examples below are Linux/Unix system oriented, i.e. they use make utility to build the "install" target after configuration with cmake.

On Windows systems with Visual Studio compiler, the CMake utility generates Visual Studio solution files by default. Build "install" project. It is also possible to generate Makefile-s on Windows by providing additional -G "NMake Makefiles" option to cmake. In this case use nmake utility instead of make.

Please review the examples below and use appropriate option that suites your needs.

Install Headers of the COMMS Library Linux Example

$> cd /path/to/comms
$> mkdir build && cd build
$> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/some/install/dir
$> make install

Build Unittests in Debug Mode Linux Example

$> cd /path/to/comms
$> mkdir build && cd build
$> cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/some/install/dir \
    -DCC_COMMS_BUILD_UNIT_TESTS=ON
$> make install

Windows + Visual Studio Build Example

Generate Makefile-s with cmake and use Visual Studio compiler to build.

$> cd /path/to/comms
$> mkdir build && cd build
$> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/some/install/dir \
    -G "NMake Makefiles"
$> nmake install

Using Clang Compiler

Please use c++14 standard with clang compiler.

$> cd /path/to/comms/sources
$> mkdir build && cd build
$> CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/some/install/dir -DCMAKE_CXX_STANDARD=14 ..
$> make install

Building Documentation

The documentation is not created during normal build process. The documentation of the COMMS Library can be generated by building doc_comms target:

$> make doc_comms

The HTML documentation will reside in ${CMAKE_INSTALL_PREFIX}/share/doc/comms/html directory.

NOTE, that you must have Doxygen and Dia being installed on your system in order to be able to properly generate the documentation.