I don’t know best practise but I’d say that the target you’re supposed to link against should have it set. That way the consumer doesn’t have to care. Many libraries do not do it which is a pity in my opinion. Somebody please correct me if I’m wrong.
That probably won’t work because after you fetch the external projects, you add it witch
add_subdirectory() to your build tree. So it becomes a part of your build and all the targets become “your” targets - it’s no longer an external library. For that you’d probably need ExternalProject…
Me neither. I’m just saying it works and I have no time looking for more sophisticated solution.