Restore projects/CMake/CMakeLists.txt (#5191)

For some reason, #5181 deleted it.
This project is intended to be a simple template to set up a project
consuming raylib with CMake.
This commit is contained in:
Peter0x44
2025-09-17 10:22:53 -07:00
committed by GitHub
parent fbdf5e4fd2
commit a15651f4fe
3 changed files with 151 additions and 0 deletions

27
projects/CMake/README.md Normal file
View File

@ -0,0 +1,27 @@
# raylib CMake Project
This provides a base project template which builds with [CMake](https://cmake.org).
## Usage
To compile the example, use one of the following dependending on your build target...
### Desktop
Use the following to build for desktop:
``` bash
cmake -B build
cmake --build build
```
### Web
Compiling for the web requires the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html):
``` bash
mkdir build
cd build
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXECUTABLE_SUFFIX=".html"
emmake make
```