File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 55### Changed
66
77- Set CMake minimum required version to ` 3.15...4.0 ` (with maximum policy version set to ` 4.0 ` ).
8+ - ` FetchContent_MakeAvailable() ` is used to populate dependencies instead of ` FetchContent_Populate() ` .
9+ - This applies to MongoDB C Driver when ` MONGOCRYPT_MONGOC_DIR ` is not set to ` USE-SYSTEM ` .
10+ - This applies to IntelDFP when ` MONGOCRYPT_DFP_DIR ` is not set to ` USE-SYSTEM ` .
11+ - Note: ` FetchContent_Populate() ` is still used for CMake versions prior to 3.18 to avoid ` add_subdirectory() ` behavior.
812
913## 1.15.0
1014
Original file line number Diff line number Diff line change @@ -27,12 +27,18 @@ FetchContent_Declare (
2727 embedded_mcd
2828 URL "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${MONGOC_FETCH_TAG_FOR_LIBBSON} .tar.gz"
2929 PATCH_COMMAND ${patch_command} --verbose
30+ SOURCE_SUBDIR "NO_ADD_SUBDIRECTORY" # add_subdirectory() is handled by ImportBSON.cmake.
3031 )
3132# Populate it:
3233FetchContent_GetProperties (embedded_mcd)
3334if (NOT embedded_mcd_POPULATED)
3435 message (STATUS "Downloading mongo-c-driver ${MONGOC_FETCH_TAG_FOR_LIBBSON} for libbson" )
35- FetchContent_Populate (embedded_mcd)
36+ if ("${CMAKE_VERSION} " VERSION_LESS "3.18.0" )
37+ # SOURCE_SUBDIR is not yet supported.
38+ FetchContent_Populate(embedded_mcd)
39+ else ()
40+ FetchContent_MakeAvailable(embedded_mcd)
41+ endif ()
3642endif ()
3743# Store the directory path to the external mongoc project:
3844get_filename_component (MONGOCRYPT_MONGOC_DIR "${embedded_mcd_SOURCE_DIR} " ABSOLUTE )
Original file line number Diff line number Diff line change @@ -44,12 +44,18 @@ FetchContent_Declare (
4444 URL "${_default_url} "
4545 ${_hash_arg}
4646 PATCH_COMMAND ${patch_command} --verbose
47+ SOURCE_SUBDIR "NO_ADD_SUBDIRECTORY" # Targets are manually defined below.
4748 )
4849
4950FetchContent_GetProperties (intel_dfp)
5051if (NOT intel_dfp_POPULATED)
5152 message (STATUS "Obtaining Intel Decimal FP library: ${INTEL_DFP_LIBRARY_URL} " )
52- FetchContent_Populate (intel_dfp)
53+ if ("${CMAKE_VERSION} " VERSION_LESS "3.18.0" )
54+ # SOURCE_SUBDIR is not yet supported.
55+ FetchContent_Populate(intel_dfp)
56+ else ()
57+ FetchContent_MakeAvailable(intel_dfp)
58+ endif ()
5359endif ()
5460
5561# This list of sources was generated by copying the MongoDB server and removing any unnecessary.
You can’t perform that action at this time.
0 commit comments