I’ll look into it. I thought the code also attempted to find a path relative to the executable, so /usr/bin/pcbnew should have produced a search path /usr/lib/kicad …
the relative path it is looking in is /usr/bin/…/plugins/3d
I had a look at the code; the problem you originally had was that an absolute path was given for the lib directory. This was a case which was missed in the code. I’ll see if I can find time to write the few lines of code to check if CMAKE_INSTALL_LIBDIR is an absolute path and to use that path if it is absolute. I think that should be OK in most cases; the exception where it would fail is when the absolute path given is for a staging directory, but in that case I don’t know of any mechanism which would help.
See https://bugs.launchpad.net/kicad/+bug/1796905 for a proper fix.