re: #375#pullrequestreview-5912458021
In commit "cmake: Pass installed include dir to mpgen" (7239a977c3000a3b075b6dd63a0c508106e7005e)
Shouldn't mpgen.mk be adjusted as well?
That'd be nice. The bug in #134 is in mpgen, not in cmake, so this PR is a partial workaround for it that could be extended to mpgen.mk. When mpgen isn't given an import path for mp/proxy.capnp, it looks under the install prefix compiled into it, so after cmake --install --prefix or moving the install, any build that runs mpgen fails, whatever build system it uses. #134 was reported through Bitcoin Core's cmake build, and this PR works around it in the cmake helper target_capnp_sources by passing the installed include directory. mpgen.mk is the equivalent helper for Make-based builds and has the same problem. It looks like a one-line fix there: the rule already runs $(MPGEN_PREFIX)/bin/mpgen, so MPGEN_PREFIX has to point at the actual install location, and the rule can pass the include directory under it:
- $(AM_V_GEN) $(MPGEN_PREFIX)/bin/mpgen '$(srcdir)' '$(srcdir)' $<
+ $(AM_V_GEN) $(MPGEN_PREFIX)/bin/mpgen '$(srcdir)' '$(srcdir)' $< '$(MPGEN_PREFIX)/include'
This assumes the include directory is include under the prefix, as the rule already assumes bin. I haven't tested it. @VijayabaskarR-06 it seems fine to add here or in a follow-up, whichever you prefer.
Separately, since Bitcoin Core's autotools build was removed, mpgen.mk may not have any users left, so it could also be reasonable to drop it in a separate PR.