Flatpak-build filesystem access doesn't seem to work

I’m trying to build a flatpak package with flatpak-builder. During the build process, cmake wants to create several files under /usr/local/share. I’ve tried adding the following section to my build file:

        - "--filesystem=/usr/local:create"

Flatpak-builder doesn’t complain about these lines, but I still get complaints from cmake about not being able to create files under /usr/local. Does anybody have a working example that does something similar?

I think I might have answered my own question. It looks like “/usr” here is really part of the flatpak runtime, not the host’s /usr. I was able to tell cmake to write things into /opt instead, and I found that /opt access is allowed by --filesystem=host:create. Things seem to be working now (at least as far as that problem goes).

the proper solution is to fix the build system (or maybe it’s called incorrectly). This is not valid.