> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Executing Builds - Cmake

Last updated on Apr 10, 2024

CMake can be used to generate SW projects with various types of build systems.In Mac environments, the common build systems are Xcode, Ninja and make.

## CMake and Xcode projects

If you generate your Xcode project using CMake (with the -G Xcode option), you should follow the instructions in [Executing Builds - Xcode](/mac/4.10.0/execute-builds-xcode).

## CMake and make or Ninja projects

If you generate your make or Ninja project using CMake (with the -G Ninja or -G "Unix Makefiles" options), you should use the following method.

When generating the project, prepend the cmake command with ib\_console, for example:

```
cmake --toolchain /opt/incredibuild/toolchain.cmake -S opencv -B bld -G Ninja
```

Then run the build, again prepending the cmake command with ib\_console, for example:

```
ib_console cmake --build bld_folder
```

**Note:** Make sure your CMakeFiles.txt does not use the CMAKE\_CXX\_COMPILER\_LAUNCHER or CMAKE\_C\_COMPILER\_LAUNCHER options (e.g. when using ccache).

You can add [additional command line options](/mac/4.10.0/execute-builds-options) to the ib\_console command to use Build Cache, add a build caption, and more.
