"use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[8883],{2794:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var o=i(4848),n=i(8453);const r={id:"ios-cmake-integration",title:"CMake Integration",slug:"/cppsdk/ios/cmake-integration",sidebar_position:1,custom_edit_url:"https://github.com/modio/modio-sdk-internal/blob/develop/platform/ios/doc/cmake-integration.mdx"},s="Inside a CMake project",a={id:"game-integration/cppsdk/ios/ios-cmake-integration",title:"CMake Integration",description:"Unzip the archive. Confirm your_project uses CMake 3.20 or later.",source:"@site/public/en-us/game-integration/cppsdk/ios/cmake-integration.mdx",sourceDirName:"game-integration/cppsdk/ios",slug:"/cppsdk/ios/cmake-integration",permalink:"/cppsdk/ios/cmake-integration",draft:!1,unlisted:!1,editUrl:"https://github.com/modio/modio-sdk-internal/blob/develop/platform/ios/doc/cmake-integration.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{id:"ios-cmake-integration",title:"CMake Integration",slug:"/cppsdk/ios/cmake-integration",sidebar_position:1,custom_edit_url:"https://github.com/modio/modio-sdk-internal/blob/develop/platform/ios/doc/cmake-integration.mdx"},sidebar:"sidebar",previous:{title:"Getting Started",permalink:"/cppsdk/ios/getting-started"},next:{title:"Getting Started",permalink:"/cppsdk/android/getting-started"}},c={},d=[];function l(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,n.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"inside-a-cmake-project",children:"Inside a CMake project"}),"\n",(0,o.jsxs)(t.p,{children:["Unzip the archive. Confirm ",(0,o.jsx)(t.code,{children:"your_project"})," uses CMake 3.20 or later."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"cmake_minimum_required(VERSION 3.20)\n"})}),"\n",(0,o.jsxs)(t.p,{children:["Specify the target platform with ",(0,o.jsx)(t.code,{children:"IOS"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"set (MODIO_PLATFORM IOS)\n"})}),"\n",(0,o.jsx)(t.p,{children:"Add the SDK subdirectory to your project"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"add_subdirectory(<modio-sdk folder> EXCLUDE_FROM_ALL)\ntarget_compile_features(your_project PUBLIC cxx_std_17)\n"})}),"\n",(0,o.jsx)(t.p,{children:"Link the library to your project."}),"\n",(0,o.jsx)(t.p,{children:"To use the header-only configuration:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"target_link_libraries(your_project PUBLIC modio)\n"})}),"\n",(0,o.jsx)(t.p,{children:"Or to use the static library configuration:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"target_link_libraries(your_project PUBLIC modioStatic)\n"})}),"\n",(0,o.jsxs)(t.p,{children:["To simplify the CMake configuration, the folder ",(0,o.jsx)(t.code,{children:"cmake/"})," has the file ",(0,o.jsx)(t.code,{children:"CMakePresets.json"})," with the basic configuration required to guide the mod.io SDK compilation using the iOS SDK. If you copy that file to the folder root, it can be used as follows:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-cmake",children:"cmake --preset ios\n"})})]})}function p(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,i)=>{i.d(t,{R:()=>s,x:()=>a});var o=i(6540);const n={},r=o.createContext(n);function s(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]);