Installing

The library can be installed using CMake (any version over 3.20).

Dependencies

Custom search paths to dependent packages can be provided with the following CMake options (or environment variable):

Option / Environment Variable

Description

Doxygen_ROOT

Add search path to doxygen program.

Sphinx_ROOT

Add search path to sphinx-build program.

ClangFormat_ROOT

Add search path to clang-format program.

Note

These feature is provided by CMake under the CMP0074 policy

Building library

Obtain a copy of the source by either downloading the zipball or cloning the public repository:

git clone git@github.com:buddly27/awesome-project.git

Then you can build and install the library as follows:

cd awesome-project
cmake -DCMAKE_INSTALL_PREFIX=/path/to/destination -S . -B ./build ..
cmake --build ./build --target install

Here are a few CMake options that can be used to influence the building process:

Option

Description

BUILD_TESTS

Indicate whether tests should be built. Default is true.

BUILD_DOCS

Indicate whether documentation should be built. Default is true.

BUILD_SHARED_LIBS

Indicate whether library should be built shared. Default is true.

CMAKE_CXX_STANDARD

Indicate the C++ standard requested. Default is C++ 14.

The build type can be influenced by the CMAKE_BUILD_TYPE option or environment variable. By default, the “Release” build type will be used.

The library can then be used by other programs or libraries via the following Cmake target:

  • AwesomeProject::AwesomeProject

Apply clang-format

Ensure that Clang-format is installed for applying C++ style.

Then run the program as follows:

cmake --build ./build --target format

Warning

When contributing, please run this command before committing your code.

Building documentation

Ensure that Doxygen and Sphinx with the required extensions are installed.

Then build the documentation as follows:

cmake --build ./build --target documentation

Note

Documentation is automatically built with default installation, unless you set the BUILD_DOCS CMake option to false.

Running tests

Ensure that GTest is installed.

Once the library and all tests are built, you can run the tests using Ctest within the build folder as follows:

ctest

You can increase the verbosity and filter in one or several tests as follows:

ctest -VV
ctest -R MyTest.DoSomething -VV
ctest -R MyTest.* -VV

Note

Tests are automatically built with default installation, unless you set the BUILD_TESTS CMake option to false.