# Problem building v4.4.0 on MacOS

**URL:** https://discourse.cmake.org/t/problem-building-v4-4-0-on-macos/15750
**Category:** Development
**Tags:** os:macos
**Created:** [July 17, 2026, 1:42am UTC](https://discourse.cmake.org/t/problem-building-v4-4-0-on-macos/15750 "2026-07-17T01:42:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![arnstein](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@arnstein](https://discourse.cmake.org/u/arnstein)
#### Post date: [July 17, 2026, 1:42am UTC](https://discourse.cmake.org/t/problem-building-v4-4-0-on-macos/15750/1 "2026-07-17T01:42:53Z")

</div>

I have the latest MacOS for ARM 26.5.2 and the latest version of Xcode. I have a spot of trouble building CMake from git tag v4.4.0. In the past, I have found Apple’s provided libiconv files to be inadequate, so I built libiconv 1.19 from a tarball and installed it into /usr/local.

In the ./bootstrap command, `find_library(LIBICONV_PATH ...)` resolves to …/MacOSX.sdk/usr/lib/libiconv.tbd instead of /usr/local/lib/libiconv.dylib . Subsequently, these tests fail:  
`AVE_ICONV_libiconv_const`  
`HAVE_ICONV_libiconv_`

This work-around is a success:  
`./bootstrap -- -DICONV_INCLUDE_DIR=/usr/local/include -DLIBICONV_PATH=/usr/local/lib/libiconv.dylib`

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [July 17, 2026, 1:49pm UTC](https://discourse.cmake.org/t/problem-building-v4-4-0-on-macos/15750/2 "2026-07-17T13:49:10Z")

</div>

This is intentional. When targeting macOS we [prefer](https://gitlab.kitware.com/cmake/cmake/-/blob/v4.4.0/Modules/Platform/Darwin.cmake#L266) the macOS SDK over `/usr/local`unless explicitly told otherwise.

One can pass `-DCMAKE_PREFIX_PATH=/usr/local`, or add `CMAKE_PREFIX_PATH=/usr/local` to the environment, in order to override the search order for all packages instead of specifying individual cache entries.

---

<div class="post-metadata">

### Author: ![arnstein](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@arnstein](https://discourse.cmake.org/u/arnstein)
#### Post date: [July 17, 2026, 6:06pm UTC](https://discourse.cmake.org/t/problem-building-v4-4-0-on-macos/15750/3 "2026-07-17T18:06:55Z")

</div>

Thank you for the explanation! I claim that my first message exposes a specific issue:  
In a MacOS environment, if an instance of libiconv has been installed to /usr/local, the CMake “bootstrap” script fails.

I understand that this issue affects only a “special” group of users: MacOS environment AND libiconv in /usr/local. But perhaps the README.rst file could use an update? Since CMake has a huge user community, a number of us are affected.
