This is a reference implementation of the model used to describe the Public Railway of PIWCS, a private Minecraft server.
See include/piwcsprwmodel.h for a detailed description of this library.
This project is licensed under GNU GPL version 3-or-later, see LICENSE for more details. Copyright © OLEGSHA 2024.
Only cmake
and a C++ compiler are required to build the library. GCC and Clang are supported.
This project uses minijson_reader and minijson_writer (specifically, the fork by ClausKlein) for JSON encoding and decoding.
Simply add this repository as a submodule and update it recursively, then add it as a CMake subdirectory and link against piwcsprwmodel
:
git submodule add <clone-url> lib/piwcsprwmodel
git submodule update --init --recursive
# In CMakeLists.txt
add_subdirectory(lib/piwcsprwmodel)
target_link_libraries(your_target piwcsprwmodel)
Clone this repository, update submodules recursively, then use CMake to build the library:
# Clone the repository
git clone <clone-url> piwcsprwmodel
cd piwcsprwmodel
# Configure the project using "build" as the build directory
cmake -B build \
-DBUILD_SHARED_LIBS=NO # Change to YES to build as shared library
# Compile the library
cmake --build build
Add piwcsprwmodel/include
to your include path. Find the compiled library in build/libpiwcsprwmodel.a
or build/libpiwcsprwmodel.a
.
Headers are documented with Doxygen comments.
To generate HTML documentation, install Doxygen, reconfigure the project and build target doxygen
. Start browsing the HTML documentation at <build-dir>/html/index.html
.
Install GoogleTest, reconfigure the project and build CMake target tests
to compile unit tests. To run tests, cd
into <build-dir>/tests
and run ctest
.
Install clang-tidy version 13 or later and reconfigure the project. All targets will now run clang-tidy checks on all compiled files.
This project uses clang-format version 13 or later for formatting. Many IDEs support .clang-format
formatting specification out of the box.