# install\_name\_tool is sporadically required by CMake when targetting macos

**URL:** https://discourse.cmake.org/t/install-name-tool-is-sporadically-required-by-cmake-when-targetting-macos/14473
**Category:** Usage
**Created:** [July 30, 2025, 8:36pm UTC](https://discourse.cmake.org/t/install-name-tool-is-sporadically-required-by-cmake-when-targetting-macos/14473 "2025-07-30T20:36:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![meator](https://discourse.cmake.org/user_avatar/discourse.cmake.org/meator/32/5700_2.png) [@meator](https://discourse.cmake.org/u/meator)
#### Post date: [July 30, 2025, 8:36pm UTC](https://discourse.cmake.org/t/install-name-tool-is-sporadically-required-by-cmake-when-targetting-macos/14473/1 "2025-07-30T20:36:18Z")

</div>

I’m trying to cross compile from a Linux host to a MacOS target. I am using Zig as my cross compiler (but I don’t think that’s relevant here, any linux-\>macos cross compiler should exhibit the same issue). Zig is special because it does not require a sysroot of the target system.

The `install_name_tool` tool seems to be required. But not when initializing language support (here I’m using C) through `project(MyApp C)`, it is required only when using `enable_language(C)` after the fact.

Here’s a minimal reproducible example:

`CMakeLists.txt`

```cmake
cmake_minimum_required(VERSION 3.12)

project(MyApp NONE)

enable_language(C)

add_executable(MyApp main.c)

```

`main.c`

```c
int main() {}

```

`toolchain-macos.cmake`

```cmake
set(CMAKE_SYSTEM_NAME "Darwin")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_C_COMPILER "/usr/bin/zig" "cc" "-target" "x86_64-macos")
set(CMAKE_CXX_COMPILER "/usr/bin/zig" "c++" "-target" "x86_64-macos")

```

Here’s the error message:

```auto
-- The C compiler identification is Clang 18.1.8
CMake Error at /usr/share/cmake-4.0/Modules/CMakeFindBinUtils.cmake:250 (message):
  Could not find install_name_tool, please check your installation.
Call Stack (most recent call first):
  /usr/share/cmake-4.0/Modules/CMakeDetermineCCompiler.cmake:201 (include)
  CMakeLists.txt:5 (enable_language)

-- Configuring incomplete, errors occurred!

```

My CMake version is `4.0.2`.
