== mod.io MacOS SDK Integration

The use of MacOS with the mod.io SDK is ready by default. You can find the `macos` directory in the platform subdirectory of your SDK installation.
You can then target `MACOS` to compile the mod.io SDK for MacOS SDK.

== MacOS SDK Versions

The mod.io SDK is built and tested against MacOS using XCode v14 & v15.1. Using different versions of the MacOS SDK may result in compilation issues.

In MacOS, the default way to compile the mod.io SDK requires CMake, which you can install following the https://cmake.org/download/[CMake webpage] instructions or using a package manager like `brew`:

[source,cmake]
----
brew install cmake ninja
----

NOTE: You can use Ninja or XCode as project generators. The former works like any other C++ project. The later will create a `.xcodeproj` file in the designated output folder.

=== Inside a CMake project

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

[source,cmake]
----
cmake_minimum_required(VERSION 3.20)
----
. Specify the target platform with ORBIS
+
[source,cmake]
----
set (MODIO_PLATFORM MACOS)
----
. Add the SDK subdirectory to your project
+
[source,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:
+
[source,cmake]
----
target_link_libraries(your_project PUBLIC modio)
----
* Or to use the static library configuration:
+
[source,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 MacOS SDK. If you copy that file to the folder root, it can be used as follows:

[source,cmake]
----
cmake --preset win
----


For more details, follow the general details described in the [mod.io repository](https://github.com/modio/modio-sdk)
