In CMake, I want to express the following: "target tgt should depend on libfoo. If libfoo is available as a dynamic library, great; otherwise, tgt should depend on the static version of libfoo".
Can I do this without verbosely and explicitly using a multi-pronged function?