---
id: mac-cmake-integration
title: CMake Integration
slug: /cppsdk/mac/cmake-integration
sidebar_position: 1
custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/macos/doc/cmake-integration.mdx
---

# Inside a CMake project

Unzip the archive. Confirm `your_project` uses CMake 3.20 or later.

```cmake
cmake_minimum_required(VERSION 3.20)
```

Specify the target platform with `MACOS`.

```cmake
set (MODIO_PLATFORM MACOS)
```
Add the SDK subdirectory to your project

```cmake
add_subdirectory(<modio-sdk folder> EXCLUDE_FROM_ALL)
target_compile_features(your_project PUBLIC cxx_std_17)
```

Link the library to your project.

To use the header-only configuration:
```cmake
target_link_libraries(your_project PUBLIC modio)
```
Or to use the static library configuration:
```cmake
target_link_libraries(your_project PUBLIC modioStatic)
```

To simplify the CMake configuration, the folder `cmake/` has the file `CMakePresets.json` with the basic configuration required to guide the mod.io SDK compilation using the Mac SDK. If you copy that file to the folder root, it can be used as follows:

```cmake
cmake --preset mac
```