Sugarcpp is a small library, which adds syntactic sugar to C++ to make your life easier.
CMake is used for compilation. There are two things to build: the library and the unit tests. Here is the short version of how to build and test everything:
Using vcpkg to install dependencies is recommended.
-
Clone or download the repository
-
Install dependencies:
vcpkg install boost-test boost-log xerces-c
- Open path in Visual Studio as CMake project.
-
md build && cd build -
cmake ../ -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg>/scripts/buildsystems/vcpkg.cmake -
Open created Visual Studio solution file in
builddirectory
sudo apt install libboost-test-dev libboost-log-dev libxerces-c-dev
If you want to use code coverage:
sudo apt install lcov gcovr
Configure and build:
-
mkdir build && cd build -
cmake ../ -
make
Run unit tests:
make test
Run unit tests and create coverage:
-
make GAlib_lcov -
make GAlib_gcov
To build shared libraries append -DBUILD_SHARED_LIBS:BOOL=ON to the above cmakecommand.
See also https://cmake.org/cmake/help/v3.15/variable/BUILD_SHARED_LIBS.html in the CMake docs.