Skip to content

A very minimal project template for Raylib using CMake that works well in CLion, Visual Studio and MSVC with Github Actions to build to all platforms

Notifications You must be signed in to change notification settings

siddharthroy12/raylib-cmake-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raylib template with CMake and Github Actions

Building to Web

You need to install Emscripten Download Here!

  1. Clone the repository using Git. Execute this in a terminal: git clone https://github.com/siddharthroy12/RaylibTemplate
  2. Cd into RaylibTemplate. cd RaylibTemplate
  3. Install the raylib git submodule using git submodule update --init --recursive --depth=1
  4. Make a build folder. Your builds will go here. mkdir build; cd build
  5. Setup cmake emcmake cmake -S .. -D CMAKE_BUILD_TYPE=Release
  6. Run cmake --build build to compile the project
  7. Run a local web server and open the RaylibTemplate.html

Building (Linux/macOS)

  1. Clone the repository using git clone https://github.com/siddharthroy12/RaylibTemplate
  2. Move to the RaylibTemplate directory cd RaylibTemplate
  3. Install the raylib git submodule using git submodule update --init --recursive --depth=1
  4. Make a build folder and cd to it with mkdir build && cd build
  5. Setup cmake cmake .. -DCMAKE_BUILD_TYPE=Release
  6. Run make to compile the project
  7. Make the binary executable chmod +x RaylibTemplate
  8. Run the binary with ./RaylibTemplate

Building (Windows, MinGW)

You need to install MinGW. Select make and developer tools in the installer Download MinGW here!

  1. Clone the repository using Git. Execute this in a terminal: git clone https://github.com/siddharthroy12/RaylibTemplate
  2. Cd into RaylibTemplate. cd RaylibTemplate
  3. Install the raylib git submodule using git submodule update --init --recursive --depth=1
  4. Make a build folder. Your builds will go here. mkdir build; cd build
  5. Setup CMake. Make sure to define MinGW Makefiles if you are using MinGW! cmake .. -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"
  6. Make sure you have mingw32-make. If you do, just run it in the build directory and it will start compiling everything. It won't take long, and once it's finished, then
  7. Run RaylibTemplate.exe! You have just compiled RaylibTemplate for Windows using MinGW.

Building (Windows, MSVC)

You need to have Visual Studio 2019 (other versions aren't tested, please tell us if it works for you) with C++ Development selected in the installer.

  1. Clone the repository using Git. Execute this in a terminal: git clone https://github.com/siddharthroy12/RaylibTemplate
  2. Cd into RaylibTemplate. cd RaylibTemplate
  3. Install the raylib git submodule using git submodule update --init --recursive --depth=1
  4. Make a build folder. Your builds will go here. mkdir build; cd build
  5. Setup CMake. cmake .. -DCMAKE_BUILD_TYPE=Release
  6. Let's build the project! Run cmake --build .
  7. Go into Debug, your build of RaylibTemplate is there. You have now compiled RaylibTemplate for Windows using MSVC.

About

A very minimal project template for Raylib using CMake that works well in CLion, Visual Studio and MSVC with Github Actions to build to all platforms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 54.2%
  • CMake 25.3%
  • HTML 20.5%