Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 2.96 KB

readme.md

File metadata and controls

58 lines (40 loc) · 2.96 KB

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: