find_library: cmake 3.18.0 resolves different path for libicucore.dylib on macOS
Repro CMakeLists.txt
:
project(icutest C)
find_library(ICUCORE icucore)
message(FATAL_ERROR "ICUCORE path: ${ICUCORE}")
On CMake 3.17.2 this prints:
ICUCORE path: /usr/lib/libicucore.dylib
On CMake 3.18.0 this prints:
ICUCORE path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libicucore.tbd
This broke us over at https://github.com/dotnet/runtime/pull/39833 since we were embedding the path returned by find_library()
so we could load ICU dynamically at runtime and the Xcode path obviously doesn't exist on a machine without Xcode.
We switched to hardcoding the path on macOS since it should be the constant anyway, but thought I'd file it nonetheless :)
Edited by Brad King