Skip to content

fix(cmake): don't pass REQUIRED to find_dependency in package config - #1

Merged
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478
Jul 30, 2026
Merged

fix(cmake): don't pass REQUIRED to find_dependency in package config#1
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478

Conversation

@hoshimoe

Copy link
Copy Markdown
Owner

Summary

Upstream fix for feedback a vcpkg maintainer gave while reviewing microsoft/vcpkg#53099:

find_dependency must generally not have REQUIRED or QUIET; the whole point of find_dependency is to forward the REQUIRED or QUIET-ness requested by the caller.

NekoEventConfig.cmake.in hard-coded REQUIRED, so find_package(NekoEvent CONFIG QUIET) raised a fatal error when NekoSchema was absent instead of returning a graceful -NOTFOUND, which is what a QUIET caller expects.

Change

  • find_dependency(NekoSchema REQUIRED)find_dependency(NekoSchema)

Verification

Built and installed into a local prefix, then configured a consumer project against the installed package:

Caller NekoSchema Result
find_package(NekoEvent CONFIG QUIET) missing exit 0, NekoEvent_FOUND=0 (was: fatal error)
find_package(NekoEvent CONFIG REQUIRED) missing fatal error — correct
find_package(NekoEvent CONFIG REQUIRED) present exit 0, FOUND=1, VERSION=1.0.1

The pre-change config was also re-tested to confirm it really did hard-fail the QUIET caller.

Version metadata is already consistent here — project(NekoEvent VERSION 1.0.1) matches the packaged 1.0.1, so the version mismatch the maintainer saw in the released v1.0.1 tarball is already fixed on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WMgcdYggBJ6aMCuNXYbRZT


Generated by Claude Code

find_dependency() forwards the REQUIRED/QUIET-ness requested by the caller
of find_package(); hard-coding REQUIRED defeats that. A consumer doing
find_package(NekoEvent CONFIG QUIET) got a fatal error instead of a graceful
-NOTFOUND when a transitive dependency was absent.

Reported by a vcpkg maintainer in microsoft/vcpkg#53099.
@hoshimoe
hoshimoe merged commit 137dbf5 into main Jul 30, 2026
16 of 23 checks passed
@hoshimoe
hoshimoe deleted the claude/neko-upstream-issues-693478 branch July 30, 2026 23:03
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.

2 participants