-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Minimal CMake
By :
A perfectly valid choice to start with is to introduce simple shell or batch scripts on your platform of choice to encapsulate common CMake commands. For example, on macOS, we could create a script called configure-default.sh that acts as an opinionated default for users to use initially and that fits with our day-to-day usage. On macOS/Linux, this might look like the following:
#!/bin/bash cmake -B build -G "Ninja Multi-Config" -DMC_GOL_SHARED=ON
To create and make this file executable, we can run the following command from the terminal:
touch configure-default.sh # modify file chmod +x configure-default.sh
On Windows, we can either rely on users using Git Bash (so that they can execute the .sh script) or create a corresponding .bat file:
@echo off cmake -B build -G "Ninja Multi-Config" -DMC_GOL_SHARED=ON
To provide more flexibility, it can also be helpful to provide several scripts and name them according...