[M5+] nix_cmake_scan filters Find*.cmake shims and picks public targets

This commit is contained in:
2026-05-10 16:18:22 +00:00
parent 6e280becbe
commit b8171e3d03
3 changed files with 105 additions and 0 deletions

View File

@@ -58,6 +58,13 @@ struct NixCmakeCandidate {
// `<alias>::<member>` forms get picked up.
auto scan_imported_targets(std::string_view config_text) -> std::vector<std::string>;
// Pure: pick the public-API subset out of a freshly scanned target
// list. See nix_cmake_scan.cpp for the rule (namespaced > stem-named
// umbrella > pass-through). Exported so unit tests can drive it
// without scaffolding an on-disk store.
auto filter_public_targets(std::vector<std::string> targets,
std::string_view stem) -> std::vector<std::string>;
// Pure: turn a CMake config filename into the find_package name.
// `fmtConfig.cmake` / `fmt-config.cmake` -> `fmt`.
auto config_stem_to_package(std::string_view filename) -> std::string;