A C++23 project template using SDL3 with Dear ImGui.
- CMake (3.15+)
- Visual Studio 2022 with "Desktop development with C++" workload
- vcpkg (only needed for first-time setup)
Run create_project.bat from your terminal in the project root:
create_project.batThat's it. It will:
- Install dependencies via vcpkg
- Move them into
Dependencies/ - Reconfigure the project to use the local folder
- Rewrite
.vcxprojpaths to use$(SolutionDir)
Then open the solution in Visual Studio and build.
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmakeCMake reads your vcpkg.json, vcpkg installs all packages into build/vcpkg_installed/x64-windows/.
Replace
C:/vcpkgwith your local vcpkg path (runvcpkg rootto find it).
rmdir /S /Q Dependencies
move build\vcpkg_installed DependenciesThis moves the folder to a top-level Dependencies/ so it survives clean builds and can be shared.
del build\CMakeCache.txt
cmake -B build -S .The first configure baked vcpkg paths into the cache. Deleting it and reconfiguring without the toolchain file makes CMake use the CMAKE_PREFIX_PATH in CMakeLists.txt, which points at Dependencies/x64-windows/. The generated .vcxproj files now reference Dependencies/ instead of the old build/vcpkg_installed/ location.
cmake --build build --config ReleaseOr open the solution in Visual Studio and hit Ctrl+Shift+B.
No vcpkg required:
cmake -B build -S .
cmake --build build- Delete
Dependencies/ - Delete
build/ - Re-run
create_project.bat(or repeat the manual steps)
├── CMakeLists.txt
├── create_project.bat
├── vcpkg.json
├── README.md
├── src/
│ └── main.cpp
└── Dependencies/ ← generated by setup, no vcpkg needed to build
└── x64-windows/
├── bin/ ← Release DLLs
├── debug/
│ ├── bin/ ← Debug DLLs
│ └── lib/ ← Debug .lib files
├── include/
├── lib/ ← Release .lib files
└── share/ ← CMake config files