CXX-3087 Replace single-argument FetchContent_Populate with FetchContent_MakeAvailable #1186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves CXX-3087. Verified by this patch.
Addresses the following warning emitted by CMake 3.30 and newer for
mongo-c-driver
andEP_mnmlstc_core
:This is caused by CMP0169:
This PR replaces such calls with
FetchContent_MakeAvailable()
accordingly.This was straightforward for
mongo-c-driver
given it was (manually) implementingadd_subdirectory()
behavior, which is consistent withFetchContent_MakeAvailable()
's regular behavior, which internally callsadd_subdirectory()
on population.EP_mnmlstc_core
required a workaround due to theSOURCE_SUBDIR
option only being supported in 3.18 and newer. UsingSOURCE_SUBDIR
to prevents the internaladd_subdirectory()
call is an officially supported pattern which is needed by FetchMnmlstcCore.cmake to prevent mnmlstc/core's configurations from leaking into the C Driver's configuration (see #1019 for details). This workaround can be removed once the minimum required CMake version is raised to 3.18 or newer.