This project provides a CMake-supported template for RayLib projects, aiming to simplify and standardize the build process across different platforms. It leverages CMake's powerful cross-platform build system capabilities to enhance Raylib project development.
- CMake Support: Simplifies building and compiling Raylib projects across Windows, Linux, and MacOS.
- Clang Format: Ensures consistent code style across your project.
- Project Structure: Organized folders for source code (src/), game resources (resources/), and CMake modules (cmake/).
- CMake
- Git
- Clang-format (optional)
- Visual Studio with C++ development tools (Windows)
- XCode (macOS)
- Basic CMake support
- Project generation
- Windows
- Linux
- MacOS
- Clang-format support
- Resource copying
Fork and Clone: Start by forking this project and cloning it to your local machine.
$ cmake -B build-mac -G Xcode -DCMAKE_BUILD_TYPE=Debug
Then go to the build-mac directory and open the generated Xcode project.
$ cmake -B build-win -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Debug
Then go to the build-win directory and open the generated Visual Studio project.
$ cmake -B build-cli -DCMAKE_BUILD_TYPE=Debug
$ cd build-cli
$ make -j$(nproc)
After building the project, you can start developing your project with Raylib by adding your source files to the src/ directory and resources to resources/. The CMake scripts are designed to handle the rest.
Every time you add a new source file and a new resources, you will need to re-run the CMake build command to update the project files before building the project.
Please note that the project is still in development and may contain bugs.
- Inspiration and base configuration adapted from SasLuca's raylib-cmake-template and Asmaloney's GDExtensionTemplate.
- Special thanks to the Raylib community for their support and contributions.