Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Challanger524/template-cpp

Repository files navigation

Template C++ CMake

С++ CMake CMakePresets Ninja EditorConfig VS Code PCH app

Feel free to pick any part or snippet you find interesting.

  • CMakeLists.txt- CMake overview - decent examples and information source
  • CMakePresets.json - build configure presets used in CMakeLists.txt via cacheVariables
    • msvc-dbg: MSVC - debug
    • gcc-dbg: GCC - debug
    • clang-dbg: Clang - debug
    • some conditional presets with sanitizers (like: gcc-san, clang-san-addr, clang-san-mem)
  • src/ - place for project' source .cpp files that are recursively globbed in CMakeLists.txt:26
    • config.hpp - (optional) precompiled header with source-wide C++ defines
  • .code-workspace - useful VS Code settings

Branches (diff):

Compare branches: https://github.com/Challanger524/template-cpp/compare

GitHub compares for branch names with slash / may be ill-formed, as shown in (?) link

Other C++ examples

Remark: I did not find any sane and useful C++ starting templates - they simply don't exist. For comparison, just take a look on what Golang community pulled out:

Projects and libraries (unfinished section)

Since there no useful templates outside - real projects are the only source of examples.

https://www.reddit.com/r/cpp_questions/comments/n73n32/presenting_a_c_project_on_github_elegantly/

Templates examples and demos
Avoid this BS:

AltStyle によって変換されたページ (->オリジナル) /