Skip to content

cmake: Fix CMake 4.5 install_prep warning for generated proxy.capnp.h - #398

Open
raus7n wants to merge 1 commit into
bitcoin-core:masterfrom
raus7n:cmake-install-prep-warning
Open

raus7n wants to merge 1 commit into
bitcoin-core:masterfrom
raus7n:cmake-install-prep-warning

Conversation

@raus7n

@raus7n raus7n commented Nov 15, 2026

Copy link
Copy Markdown

Fixes #397.

CMake 4.5 expects every generated file that a target installs to be the
output of a custom command attached to exactly one target. Otherwise it
emits the author warning reported in #397 for the Makefile generators.

capnp_generate_cpp() lists both proxy.capnp.c++ and proxy.capnp.h as
outputs of one command, which ended up attached to both mp_headers and
multiprocess. Adding add_dependencies(multiprocess mp_headers), as the
warning suggests, does not help: the command is still attached to two targets.

This change runs the same capnp compile command directly, with
proxy.capnp.c++ as a byproduct, so the command is attached only to
mp_headers. multiprocess no longer lists the generated header as a source
(it is still installed through PUBLIC_HEADER) and depends on mp_headers
so the generated source exists before it is compiled. mp_headers still only
generates headers and does not compile anything.

Tested with CMake 4.5.0: the warning is gone with Makefile and Ninja
generators.

@DrahtBot

DrahtBot commented Nov 15, 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.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • CMakeLists.txt: Capn'Proto → Cap'n Proto [misspelling]

2026-11-15 22:50:56

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.

CMake 4.5 warning about "install_prep/" targets

2 participants