Skip to content

cmake: Pass installed include dir to mpgen - #375

Open
VijayabaskarR-06 wants to merge 1 commit into
bitcoin-core:masterfrom
VijayabaskarR-06:fix-install-prefix
Open

VijayabaskarR-06 wants to merge 1 commit into
bitcoin-core:masterfrom
VijayabaskarR-06:fix-install-prefix

Conversation

@VijayabaskarR-06

Copy link
Copy Markdown

Fixes #134.

mpgen was looking for proxy.capnp using the path from when libmultiprocess was built. If the library was installed with a different prefix then the downstream builds failed with Import failed: /mp/proxy.capnp.

This change passes the installed include path from Libmultiprocess::mpgen to mpgen so it can find the file after installation.

Subdirectory builds and builds using MPGEN_EXECUTABLE are unchanged.

I tested this with Bitcoin Core's bitcoin_ipc target. It works with this change and also compared it with main !

mpgen finds /mp/proxy.capnp using the CMAKE_INSTALL_PREFIX that was set
when it was built. If libmultiprocess is installed somewhere else, for
example with `cmake --install build --prefix ~/.local`, or the install is
moved, code generation fails with "Import failed: /mp/proxy.capnp".

When target_capnp_sources uses the imported Libmultiprocess::mpgen
target, pass its include directory to mpgen as an import path. That path
comes from the installed package location, so it is correct wherever
the package ends up. Builds that use libmultiprocess as a subdirectory
already pass MP_INCLUDE_DIR and are unchanged.

Fixes bitcoin-core#134
@DrahtBot

DrahtBot commented Oct 7, 2026 •

Copy link
Copy Markdown

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installing in ${HOME}/.local causes build error

2 participants