Problem building v4.4.0 on MacOS

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

This is intentional. When targeting macOS we prefer the macOS SDK over /usr/localunless 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.

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.