How to say "Depend on libfoo, dynamically if possible" in CMake

37 Views Asked by At

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?

0

There are 0 best solutions below