From f93a723b9cc6c991db584559848762c141e9a977 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Jul 2026 14:07:32 +0000 Subject: [PATCH] fix(cmake): don't pass REQUIRED to find_dependency in package config find_dependency() forwards the REQUIRED/QUIET-ness requested by the caller of find_package(); hard-coding REQUIRED defeats that. A consumer doing find_package(NekoFunction 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. --- cmake/NekoFunctionConfig.cmake.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/NekoFunctionConfig.cmake.in b/cmake/NekoFunctionConfig.cmake.in index b67320e..0a06c9d 100644 --- a/cmake/NekoFunctionConfig.cmake.in +++ b/cmake/NekoFunctionConfig.cmake.in @@ -1,8 +1,10 @@ @PACKAGE_INIT@ # Find required dependencies +# Note: find_dependency() must not be given REQUIRED or QUIET; it forwards the +# REQUIRED/QUIET-ness requested by the caller of find_package(NekoFunction). include(CMakeFindDependencyMacro) -find_dependency(NekoSchema REQUIRED) +find_dependency(NekoSchema) # Find optional dependencies based on enabled features # These are set during package configuration @@ -10,11 +12,11 @@ set(NEKO_FUNCTION_HAS_HASH @NEKO_FUNCTION_ENABLE_HASH@) set(NEKO_FUNCTION_HAS_ARCHIVE @NEKO_FUNCTION_ENABLE_ARCHIVE@) if(NEKO_FUNCTION_HAS_HASH) - find_dependency(OpenSSL REQUIRED) + find_dependency(OpenSSL) endif() if(NEKO_FUNCTION_HAS_ARCHIVE) - find_dependency(minizip-ng REQUIRED) + find_dependency(minizip-ng) endif() # Include the targets file