The workaround you proposed looks like it is bogus and just hides the problem because it tells it to look for libraries in a non-existent directory (as nothing is named /usr/lib/clang /usr/lib/libfoo.so …). Can you provide the CMake code that triggered this? If you can minimize it by removing extraneous details and still happening, that’d be even better.
I will try to reproduce with the smallest possible Cmake script. In the meantime, if anything obvious can be found ;), here is the one the CMake script used: