Improve compatibility with FetchContent
There were a number of issues when fetching Darwin with FetchContent in downstream repos:
- Using
CMAKE_{BINARY,SOURCE}_DIRmixed up Darwin and the downstream project. This prevented finding libgit2 and messed up install paths. UseCMAKE_CURRENT_{BINARY,SOURCE}_DIRinstead. - Some target names were too generic and produced conflicts:
CreateVersionHeaderand the ROOT dictionary target. Rename them withPROJECT_NAME. - No
Darwin::Darwinalias target was created for the downstream project to use. Now it's the case. - The downstream project could not use the Darwin target because include directories were not propagated correctly.
Edited by Patrick Louis S Connor