Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enkisoftware/glfw-cmake-starter
Use CMake to create a project with GLFW - Multi-platform Windows, Linux and MacOS.
https://github.com/enkisoftware/glfw-cmake-starter
c c-plusplus cmake cpp gamedev glfw linux macos multi-platform opengl unix windows
Last synced: about 4 hours ago
JSON representation
Use CMake to create a project with GLFW - Multi-platform Windows, Linux and MacOS.
- Host: GitHub
- URL: https://github.com/enkisoftware/glfw-cmake-starter
- Owner: enkisoftware
- License: zlib
- Created: 2020-02-08T16:36:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T13:20:11.000Z (4 months ago)
- Last Synced: 2024-07-16T16:09:39.233Z (4 months ago)
- Topics: c, c-plusplus, cmake, cpp, gamedev, glfw, linux, macos, multi-platform, opengl, unix, windows
- Language: CMake
- Homepage:
- Size: 11.7 KB
- Stars: 144
- Watchers: 5
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
Support our work through [GitHub Sponsors](https://github.com/sponsors/dougbinks) or [Patreon](https://www.patreon.com/enkisoftware)
[](https://github.com/sponsors/dougbinks) [](https://www.patreon.com/enkisoftware)
# GLFW CMake starter
This starter project shows how to use CMake to create a project with GLFW. The code is multi-platform and runs on Windows, Linux and MacOS.
GLFW homepage: [glfw.org](https://www.glfw.org/)
GLFW on GitHub: [github.com/glfw/glfw](https://www.github.com/glfw/glfw)## Getting the code
The easiest way to get hold of the starter code is to run the following command using a shell you can run git from:
```
git clone --recursive https://github.com/juliettef/GLFW-CMake-starter
```If you are on Windows you can download git from [git-scm.com/download/win](https://git-scm.com/download/win) and use the right click menu in Windows File Explorer to "Git Bash here" and then run git commands.
This will create the directory _GLFW-CMake-starter_ and get the latest source code, using the ```--recursive``` option to download the GLFW code which is included in the repository as a submodule. If you want to run further git commands from the command line you'll need to cd into the directory:
```
cd GLFW-CMake-starter
```Alternatively you can use a git GUI program such as [Fork](https://git-fork.com/) to get the code. Most of these will automatically download the git submodules.
If you download the code from GitHub via the "Download ZIP" approach, you'll also need to download GLFW into the _glfw_ folder. The correct version can be found by clicking on the _glfw_ folder you see on the [front page of the _GLFW-CMake-starter_ GitHub repository](https://github.com/juliettef/GLFW-CMake-starter).
## Using CMake to create the project
From a command prompt in the `GLFW-CMake-starter` directory:
1. `mkdir build`
1. `cd build`
1. `cmake ..` (for MinGW the build system generator needs to be specified using the -G option: `cmake .. -G "MinGW Makefiles"`)
1. Either run `make all` or for Visual Studio open `GLFW-CMake-starter.sln` or for MinGW run `mingw32-make`