# CMAKE\_OSX\_DEPLOYMENT\_TARGET not setting min version? (Xcode, clang)

**URL:** <https://discourse.cmake.org/t/cmake-osx-deployment-target-not-setting-min-version-xcode-clang/8399>\
**Category:** Code\
**Created:** [June 23, 2023, 4:05pm UTC](https://discourse.cmake.org/t/cmake-osx-deployment-target-not-setting-min-version-xcode-clang/8399 "2023-06-23T16:05:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsetlik](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hsetlik/32/3548_2.png) [@hsetlik](https://discourse.cmake.org/u/hsetlik)\
**Post date:** [June 23, 2023, 4:05pm UTC](https://discourse.cmake.org/t/cmake-osx-deployment-target-not-setting-min-version-xcode-clang/8399/1 "2023-06-23T16:05:49Z")

</div>

Hi all,  
I have a GUI macOS app that gets built with CMake and the Xcode generator. The version and architectures are set up like this:

```auto
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)

```

Even with the target set to 10.13, builds from my machine (Intel Mac running Ventura 13.4) give an error on pre 13.3 systems that macOS 13.3 or newer is required. I read through CMake’s output, clang is being called with `-target arm64-apple-macos10.13` so I guess it’s not a compiler flag issue. Might it be an issue with the Xcode generator or an incorrect version of the mac SDK or something?  
Any insight or advice much appreciated!

---

<div class="post-metadata">

**Author:** ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Post date:** [June 23, 2023, 9:58pm UTC](https://discourse.cmake.org/t/cmake-osx-deployment-target-not-setting-min-version-xcode-clang/8399/2 "2023-06-23T21:58:37Z")

</div>

I don’t recall which ones, but some of the Apple-specific variables have to be set as cache variables, not just regular variables (at least, with some versions of CMake this has been the case, I think it still is). Try defining them as cache variables from the `cmake` command line or a toolchain file and see if that makes any difference to the project you’re testing this with.
