SciCompMod / memilio

Modular spatio-temporal models for epidemic and pandemic simulations
https://scicompmod.github.io/memilio/
Apache License 2.0
52 stars 15 forks source link

Use FetchContent_MakeAvailable instead of FetchContent_Populate? #1027

Open lenaploetzke opened 1 month ago

lenaploetzke commented 1 month ago

Motivation / Current Behaviour

Currently we use the structure

FetchContent_GetProperties(eigen)
if(NOT eigen_POPULATED)
   FetchContent_Populate(eigen)
endif()

for most dependencies. In some cases, it might be possible to use FetchContent_MakeAvailable() which is recommended (see also https://cmake.org/cmake/help/latest/module/FetchContent.html) instead of using FetchContent_GetProperties() and FetchContent_Populate() directly.

Enhancement description

Use FetchContent_MakeAvailable() instead of FetchContent_GetProperties() and FetchContent_Populate(). We may need to set the option OVERRIDE_FIND_PACKAGE or similar to prevent the search for local versions.

We could also discuss whether we want to allow searching for local versions and only downloading otherwise (and not controlling this via the MEMILIO_USEBUNDLED options). This could speed up the build especially because of downloading boost.

Additional context

No response

Checklist