ProjGeom 1.0.11
Loading...
Searching...
No Matches
ProjGeom

Actions Status Actions Status Actions Status Actions Status codecov

🔯 projgeom-cpp

Projective geometric for modern C++.

✨ Features

Usage

Adjust the template to your needs

  • Use this repo as a template.
  • Replace all occurrences of "ProjGeom" in the relevant CMakeLists.txt with the name of your project
    • Capitalization matters here: ProjGeom means the name of the project, while projgeom is used in file names.
    • Remember to rename the include/projgeom directory to use your project's lowercase name and update all relevant #includes accordingly.
  • Replace the source files with your own
  • For header-only libraries: see the comments in CMakeLists.txt
  • Add your project's codecov token to your project's github secrets under CODECOV_TOKEN
  • Happy coding!

Eventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project. Feel free to replace the License with one suited for your project.

The single root CMakeLists.txt defines the library, standalone executable, benchmark and tests. During development it is usually convenient to build everything at once (the default).

Build and run the standalone target

Use the following command to build and run the executable target.

cmake -S. -B build
cmake --build build
./build/ProjGeom --help

Build and run test suite

Use the following commands from the project's root directory to run the test suite.

cmake -S. -B build
cmake --build build
ctest --test-dir build --output-on-failure
# or maybe simply call the executable:
./build/ProjGeomTests

To collect code coverage information, run CMake with the -DPROJGEOM_ENABLE_COVERAGE=ON option (GCC/Clang only) and build the coverage target.

Run clang-format

Use the following commands from the project's root directory to check and fix C++ and CMake source style. This requires clang-format, cmake-format and pyyaml to be installed on the current system.

cmake -S . -B build
# view changes
cmake --build build --target format
# apply changes
cmake --build build --target fix-format

See Format.cmake for details.

Build the documentation

The documentation is automatically built and published whenever a GitHub Release is created. To manually build documentation, call the following command.

cmake -S . -B build -DPROJGEOM_BUILD_DOCS=ON
cmake --build build --target GenerateDocs
# view the docs
open build/doxygen/html/index.html

To build the documentation locally, you will need Doxygen, jinja2 and Pygments on installed your system.

Additional tools

Static analysis

clang-tidy can be enabled by configuring CMake with -DPROJGEOM_ENABLE_CLANG_TIDY=ON; this provides a clang-tidy target that analyzes the public headers.

Code coverage

Code coverage (GCC/Clang, via gcovr) can be enabled by configuring CMake with -DPROJGEOM_ENABLE_COVERAGE=ON; this provides a coverage target that runs the tests and writes an HTML report to build/coverage/index.html.

Related projects and alternatives