Skip to content

An example project which demonstrates the use of ClangFormat CMake module

License

Notifications You must be signed in to change notification settings

zemasoft/clangformat-cmake-example

Repository files navigation

language.badge license.badge travis.badge

ClangFormat.cmake module example

This is a minimalistic C++ project which demonstrates the use of ClangFormat.cmake module which can be found here.

Requirements

The module itself requires CMake 3.0 or higher and any version of clang-format installed. You will also need a C++ compiler for CMake to be able to generate the build system.

Usage

  1. Obtain the project:

    $ git clone https://github.com/zemasoft/clangformat-cmake-example
    $ cd clangformat-cmake-example
    $ git submodule update --init --recursive
  2. Generate the build system:

    $ cmake -S . -Bbuild
  3. Format sources anytime using clangformat target:

    $ cmake --build build --target clangformat

    or:

    $ cd build
    $ make clangformat
  4. Build the project:

    $ cmake --build build

    or:

    $ cd build
    $ make

Notes

About

An example project which demonstrates the use of ClangFormat CMake module

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published