| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository provides a ready-to-use template for C++ projects based on CMake and VCPKG, with a bootstrap script to generate a fresh project quickly. It includes:
Note: This template has been primarily tested on macOS. If you encounter issues on other platforms or have improvements, feel free to open a pull request!
Clone this repository (optionally with submodules if you want a local vcpkg directory):
git clone --recurse-submodules https://github.com/<username>/<repo-name>.gitIf you forgot --recurse-submodules, you can do:
git submodule update --init --recursive
Run the bootstrap script to generate a new project with your custom name and namespace:
# On macOS/Linux:
./bootstrap.sh <ProjectName> <NamespaceName>
# On Windows (Command Prompt or PowerShell):
bootstrap.bat <ProjectName> <NamespaceName>For example:
./bootstrap.sh MyNewApp my_namespaceThis will create a standalone folder called MyNewApp, initialize a Git repository there, optionally copy vcpkg, and remove the original template files.
Inside your newly created project folder (e.g. MyNewApp), you can use the existing CMake Presets instead of manually typing out all CMake options. Some examples:
Configure with the debug preset:
cmake --preset=debugBuild using the same preset
cmake --build --preset=debugYou can inspect available presets by running:
cmake --list-presetsBefore running the bootstrap script, you might see:
. ├─ vcpkg/ # (Optional) vcpkg submodule ├─ template/ # .in files: CMakeLists.txt.in, main.cpp.in, etc. ├─ bootstrap.sh # Script for generating a new project (macOS/Linux) ├─ bootstrap.bat # Script for generating a new project (Windows) ├─ bootstrap.CMakeLists.txt # CMake logic to transform .in files into actual project files ├─ README.md # This documentation └─ ... (other configs like .clang-format.in, .clang-tidy.in)
After the script finishes, you’ll have:
MyNewApp/ ├─ include/ │ └─ MyNewApp.hpp # Example generated header ├─ src/ │ └─ main.cpp # Example generated main ├─ tests/ │ ├─ CMakeLists.txt │ └─ test_sample.cpp ├─ vcpkg/ # Copied submodule (if present) ├─ CMakeLists.txt ├─ CMakePresets.json ├─ CMakeUserPresets.json ├─ vcpkg.json ├─ .clang-format ├─ .clang-tidy └─ (other generated/adjusted files)
If you want to add new features, fix issues, or test on other platforms (Windows, Linux, etc.), we welcome pull requests and any feedback. Feel free to open issues for discussion about best practices or new ideas.
This template has been primarily tested on macOS. Windows and Linux users are encouraged to try it out, adapt it, and submit changes if needed. We make no guarantee it works out of the box for all environments but will happily accept patches to improve cross-platform support!
| Back | FazBrowse Home | New Git URL |