/cpp-bp

C++ project boilerplate with cmake and Catch2.

Primary LanguageCMake

  • Build project

    • Debug

      $ mkdir build-debug
      $ cmake -DCMAKE_BUILD_TYPE=Debug -B build-debug -S .
      $ cmake --build build-debug -t main_library
      $ cmake --build build-debug -t help  # for more info about targets
    • Release

      $ mkdir build-release
      $ cmake -DCMAKE_BUILD_TYPE=Release -B build-release -S .
      $ cmake --build build-release -t all  # build everything!!!
    • Development

      $ mkdir build-dev
      $ cmake -DCMAKE_BUILD_TYPE=??? -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -B build-dev -S .
      $ cmake --build build-dev -t all  # build everything!!!
      $ ln -s $PWD/build-dev/compile_commands.json $PWD/compile_commands.json
  • Tests

    $ cmake --build build* -t testlib  # build tests
    $ cmake --build build* -t test  # run tests
  • DOC (not yet ready)

    $ cmake --build build* -t doc

Credits

Based on modern-cmake, specifically this.