Building GLFW on Mac OS X

GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan. This platform provides a simple, API for creating windows, contexts and surfaces, reading input, handling events, etc. To allow you to provide a surface and a way to interact with your 3D graphics. There are others available such as SDL.

Dependencies:

  1. Install and launch XCode from the app store.
  2. Install CMake (I use brew: brew install cmake)

You could download a pre-compiled binary, however, it is better to build this on your system so it takes into account your GPU type etc.

To build GLFW from source do the following

  1. Download and extract the GLFW source code and put in the location of your choice
  2. Open the Terminal and cd to root the directory that GLFW has been extracted too (the one that contains
  3. cd to the extracted directory.
  4. Type: cmake (hit return).
  5. A Makefile will be created for you.
  6. Type: make (hit return).
  7. After the compilation process, type: sudo make install

The libraries will be copied to /usr/local/lib, and the header files copied to /usr/local/include.

So you should be good to go! Happy programming.