This project uses CMake cross-platform build system to generate required build files native to the platform.
In addition to built-in options/variables of CMake, such as CMAKE_BUILD_TYPE, CMAKE_INSTALL_PREFIX, or CMAKE_TOOLCHAIN_FILE, the following ones can be used:
-
CC_COMMS_LIB_ONLY=ON/OFF - Exclude compilation of all the tools, install only COMMS Library. Default value is OFF, i.e. other tools get built.
-
CC_NO_UNIT_TESTS=ON/OFF - Exclude build of unit tests. Default value is OFF, i.e. the unit tests get built.
-
CC_NO_WARN_AS_ERR=ON/OFF - By default, all warnings are treated as errors. Enable this option in case the compiler generates warning and fails the compilation. Please open the issue when such scenario occurs. Default value is OFF.
-
CC_STATIC_RUNTIME=ON/OFF - Enable/Disable static link to C++ runtime. Default value is OFF
-
CC_QT_DIR=dir - Directory of QT5 installation. Can be used to provide path to QT5 if differs from system default installation path.
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 has problems compiling valid c++11 constructs used in this project. Hence, the compilation will fail unless the compilation is configured to use c++14 standard.
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. Remember to add -DCMAKE_BUILD_TYPE=Release option for release builds.
This example will skip build of any tool available, it will just install the COMMS library headers in install/include subdirectory.
$> cd /path/to/comms_champion
$> mkdir build && cd build
$> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/some/install/dir \
-DCC_COMMS_LIB_ONLY=ON -DCC_NO_UNIT_TESTS=ON ..
$> make install
Generate Makefile-s with cmake and use Visual Studio compiler to build.
$> cd /path/to/comms_champion
$> mkdir build && cd build
$> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/some/install/dir \
-DCC_QT_DIR=C:\Qt\Qt5.7.1\5.7\msvc2015 -G "NMake Makefiles" ..
$> nmake install
On Windows platform, there is also deploy_qt build target. When built, it invokes windeployqt.exe utility, provided by Qt5 installation, to deploy all relevant Qt libraries to the installation directory.
$> nmake deploy_qt
Please use c++14 standard with clang compiler.
$> cd /path/to/comms_champion/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
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 documentation of the CommsChampion Library used to develop a plugin to CommsChampion Tools can be generated by building doc_commschampion target:
$> make doc_commschampion
The HTML documentation will reside in ${CMAKE_INSTALL_PREFIX}/doc/comms_champion/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.