zemasoft / clangformat-cmake-example

An example project which demonstrates the use of ClangFormat CMake module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:Boost Software License 1.0


Languages

Language:C++ 55.6%Language:CMake 44.4%