Improve compatibility with FetchContent

There were a number of issues when fetching Darwin with FetchContent in downstream repos:

  • Using CMAKE_{BINARY,SOURCE}_DIR mixed up Darwin and the downstream project. This prevented finding libgit2 and messed up install paths. Use CMAKE_CURRENT_{BINARY,SOURCE}_DIR instead.
  • Some target names were too generic and produced conflicts: CreateVersionHeader and the ROOT dictionary target. Rename them with PROJECT_NAME.
  • No Darwin::Darwin alias 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

Merge request reports

Loading