{"id":26902527,"url":"https://github.com/dvir-yona/cpp-cmake-base-project","last_synced_at":"2026-05-05T07:32:43.894Z","repository":{"id":277158759,"uuid":"929733403","full_name":"dvir-yona/Cpp-Cmake-Base-Project","owner":"dvir-yona","description":"A template for C++ projects using CMake, featuring support for GCC and Clang compilers, debug and release build modes, gdb and valgrind, and a run.sh script to simplify building and running the project.","archived":false,"fork":false,"pushed_at":"2025-03-27T10:00:47.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T10:29:19.320Z","etag":null,"topics":["c-plus-plus","cmake","cpp","ninja"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvir-yona.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T09:06:12.000Z","updated_at":"2025-03-27T10:01:35.000Z","dependencies_parsed_at":"2025-02-12T13:32:43.644Z","dependency_job_id":"55bbcdaf-9dbc-444d-abec-58cd8c331435","html_url":"https://github.com/dvir-yona/Cpp-Cmake-Base-Project","commit_stats":null,"previous_names":["dvir-yona/cpp-cmake-base-project"],"tags_count":3,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvir-yona%2FCpp-Cmake-Base-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvir-yona%2FCpp-Cmake-Base-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvir-yona%2FCpp-Cmake-Base-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvir-yona%2FCpp-Cmake-Base-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvir-yona","download_url":"https://codeload.github.com/dvir-yona/Cpp-Cmake-Base-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620211,"owners_count":20806718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cmake","cpp","ninja"],"created_at":"2025-04-01T09:43:51.278Z","updated_at":"2026-05-05T07:32:43.863Z","avatar_url":"https://github.com/dvir-yona.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cpp-Cmake-Base-Project\n\nThis repository provides a starting point for C++ projects using CMake as the build system. It includes a simple `main.cpp`, a CMake configuration with presets for various compilers and build types, and a `run.sh` script to streamline building and running the project.\n\n## Features\n\n- **Compiler Support**: Choose between GCC and Clang.\n- **Build Modes**: Debug (with address sanitization) and Release.\n- **Debugging**: Run the program in GDB.\n- **Profiling**: Generate profiling data using Valgrind and visualize it with KCachegrind.\n- **Dependency Management**: Automatically installs required dependencies listed in `deps.txt`.\n\n## Prerequisites\n\n- An Ubuntu or Debian-based system (for dependency installation via `apt`).\n- Git (to clone the repository).\n\n## Installation\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/yourusername/Cpp-Cmake-Base-Project.git\n   cd Cpp-Cmake-Base-Project\n   ```\n2. **Run the build Script**:\n   ```bash\n   ./run.sh\n   ```\n   The script will automatically install dependencies listed in deps.txt (requires sudo privileges).\n## Usage\nThe run.sh script simplifies building and running the project with various options. Here’s how to use it:\n### Options\n- -R: Build in Release mode (default is Debug).\n- -C: Use Clang as the compiler (default is GCC).\n- -D: Run the program in GDB for debugging.\n- -P: Generate profiling data and visualize it with KCachegrind.\n- -F: Force a clean build by removing existing build directories.\n- -h: Display the help message.\n## Project Structure\n\n- **src/**: Contains source files (.cpp), e.g., main.cpp.\n- **include/**: Place your header files (.h) here to ensure they are included in the build.\n- **build/**: Stores build artifacts, organized by preset (e.g., gcc-debug, clang-release).\n- **profiling/**: Holds profiling data generated with the -P option.\n  This generates profiling data in profiling/profile.out and opens it in KCachegrind for visualization.\n- **run.sh**: Script to build and run the project.\n- **CMakeLists.txt**: CMake configuration file.\n- **CMakePresets.json**: Defines build presets for different configurations.\n- **deps.txt**: Lists required dependencies.\n---\n## License\n   This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvir-yona%2Fcpp-cmake-base-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvir-yona%2Fcpp-cmake-base-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvir-yona%2Fcpp-cmake-base-project/lists"}