-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Minimal CMake
By :

We’ve removed a lot of manual steps that we were dealing with at the start of the chapter, but one remains. This is the requirement to build the shaders needed by bgfx to transform and color our geometry. Up until now, we’ve been relying on running custom .bat
/.sh
scripts from the app
folder before running our Game of Life application, but there’s a better possibility. In this section, we’ll show how to make this process part of the build itself, and use CMake to achieve a cross-platform solution without the need for OS-specific scripts.
To start with, we’re going to do away with our existing .bat
/.sh
scripts and replace them with .cmake
files. We’ll pick macOS as the first platform to update; the file will be called compile-shader-macos.cmake
, and will live under a new cmake
folder in the app
directory (equivalent files for Windows and Linux will differ in the exact same way as the existing scripts).
We...