Minimal game template using raylib as a git submodule and CMake.
This repository is intended to be used as a starting point for a new raylib project
git clone --recursive to get the raylib submodule local
If you forgot:
git submodule update --init --recursive after regular git clone
What your project architecture should ideally look like for the CMakeLists.txt I've included (Can change accordingly, otherwise)
‖
‖——CMakeLists.txt
‖——src/
‖ ‖——main.cpp
‖ ‖——*.cpp → all other source files
‖——raylib/ → your raylib engine (submodule)
mkdir build
cd build
cmake --preset Debug OR cmake --preset Release -- (configuration of cmake)
cmake --build --preset Debug OR cmake --build --preset Release -- (compilation + build of your files, only what has changed since last build)
Executable will appear in build/ under preset name
Put any new .cpp or .c files in src/
Update CMakeLists.txt as needed, example:
add_executable(YourProjectName
src/main.cpp
src/other_file.cpp
)cd raylib
git pull
cd ..
git commit -a -m "Update raylib"
- CMake 3.20+
- C++17 compiler
- MinGW / MSVC / Clang
- Ninja (not required, but it's what the presets use)