I was using your answer (for a nur pkg) and after wondering for while, why cmake was still trying to fetch content i realised a mistake in your answer:
it shoule be -DFETCHCONTENT_SOURCE_DIR_HELLO=/nix/store/...-hello
(UPPERCASE) instead of the lower-case hello.
i found that in the cmake docs
and your parsing code also calls toUpper here
could you edit that, for future people using your answer? (or we just hope future ppl read on for a few answers…)