# CMake cannot detect swift compiler in OS Ventura

**URL:** https://discourse.cmake.org/t/cmake-cannot-detect-swift-compiler-in-os-ventura/7113
**Category:** Usage
**Tags:** os:macos
**Created:** [December 22, 2022, 11:07am UTC](https://discourse.cmake.org/t/cmake-cannot-detect-swift-compiler-in-os-ventura/7113 "2022-12-22T11:07:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zohar81](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zohar81/32/2252_2.png) [@zohar81](https://discourse.cmake.org/u/zohar81)
#### Post date: [December 22, 2022, 11:07am UTC](https://discourse.cmake.org/t/cmake-cannot-detect-swift-compiler-in-os-ventura/7113/1 "2022-12-22T11:07:43Z")

</div>

Hi, I’m working on macOS and have updated my OS version recently. when I try to build swift based library generated from cmake, I fail on the following line

```auto
enable_language(Swift)

```

since the compiler couldn’t be found (although I’ve properly installed Xcode+developer tools)  
Here’s the relevant output

```auto
-- The Swift compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also "/Users/me/myProj/CMakeFiles/CMakeOutput.log".
See also "/Users/me/myProj/CMakeFiles/CMakeError.log".
CMake Error at CMakeLists.txt:17 (enable_language):
No CMAKE_Swift_COMPILER could be found

```

Here’s my swift compiler location

```auto
❯ xcrun swift -version
Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-darwin22.2.0
❯ xcrun --find swift
/Library/Developer/CommandLineTools/usr/bin/swift

```

Perhaps there’s a way to explicitly set the compiler pointer ?

Thanks !

---

<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: [December 22, 2022, 10:44pm UTC](https://discourse.cmake.org/t/cmake-cannot-detect-swift-compiler-in-os-ventura/7113/2 "2022-12-22T22:44:09Z")

</div>

Can you attach the contents of the `CMakeOutput.log` and `CMakeError.log` files mentioned in your output?

Also make sure you’ve started up the Xcode IDE at least once after you updated. I vaguely recall sometimes needing to accept a license or install additional components in the past and this affected the ability of command line tools being able to build things.

---

<div class="post-metadata">

### Author: ![bkoz](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bkoz/32/3238_2.png) [@bkoz](https://discourse.cmake.org/u/bkoz)
#### Post date: [March 8, 2023, 6:16pm UTC](https://discourse.cmake.org/t/cmake-cannot-detect-swift-compiler-in-os-ventura/7113/3 "2023-03-08T18:16:07Z")

</div>

Thanks! Running the xcode UI for the first time fixed the unknown compiler issue.
