Okay, as you can guess from the subject header this is a complex question spanning multiple systems but I think the problem is with cmake.
For a project, a small interpreter named egel, I now develop on a Macbook Air M1, an Apple Silicon system. The project compiles fine on various Linuxes and BSDs. Not so much on Apple Silicon.
I install the project with git clone. I install the dependencies with homebrew, those go under /opt/homebrew. Libicu (or icu4c as it’s called as a package) goes there.
Everything is compiled out of source in a ‘build’ directory. To make cmake aware what libicu it needs I run ‘cmake … -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/icu4c’. That produces the necessary makefiles.
However, make returns ’ /Users/username/Programming/egel/src/runtime.hpp:13:10:fatal error:‘unicode/unistr.h’ file not found’, i.e., clang fails to find the necessary libicu headers.
My conclusion is that the makefiles generated do not point at the right headers, and probably also not at the right libicu system library, due to those (on Apple Silicon) being installed under /opt/homebrew/… instead of under /opt/include.
The ICU libraries should have a usage requirement of their include directories. It sounds like an issue with whatever config file or find module is used.
Yah, as a post-mortem: The application has three dependencies (fmt, libicu, threads). It’s plain weird that cmake functions for the other two packages but not libicu.
But I have my fix. Maybe a FindICU maintainer can look at this once.