2022-11-03 05:39:31 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-11-17 08:52:43 +08:00
|
|
|
index 1fe4c76..96be699 100644
|
2022-11-03 05:39:31 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-11-17 08:52:43 +08:00
|
|
|
@@ -347,11 +347,9 @@ if (USE_SYSTEM_LIBBSON)
|
2022-11-03 05:39:31 +08:00
|
|
|
|
|
|
|
set (USING_SYSTEM_BSON TRUE)
|
|
|
|
if (NOT TARGET mongo::bson_shared)
|
|
|
|
- message (FATAL_ERROR "System libbson built without shared library target")
|
|
|
|
endif ()
|
|
|
|
set (BSON_LIBRARIES mongo::bson_shared)
|
|
|
|
if (NOT TARGET mongo::bson_static)
|
|
|
|
- message (FATAL_ERROR "System libbson built without static library target")
|
|
|
|
endif ()
|
|
|
|
set (BSON_STATIC_LIBRARIES mongo::bson_static)
|
|
|
|
endif ()
|
2023-11-17 08:52:43 +08:00
|
|
|
diff --git a/build/cmake/libmongoc-1.0-config.cmake.in b/build/cmake/libmongoc-1.0-config.cmake.in
|
|
|
|
index a068408..d0aeadd 100644
|
|
|
|
--- a/build/cmake/libmongoc-1.0-config.cmake.in
|
|
|
|
+++ b/build/cmake/libmongoc-1.0-config.cmake.in
|
|
|
|
@@ -24,6 +24,9 @@ set (MONGOC_VERSION_FULL @libmongoc_VERSION_FULL@)
|
|
|
|
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency (mongoc-1.0)
|
|
|
|
+if("@ENABLE_SNAPPY@" STREQUAL "ON")
|
|
|
|
+ find_dependency(Snappy CONFIG)
|
|
|
|
+endif()
|
|
|
|
|
|
|
|
set(MONGOC_LIBRARY mongo::mongoc_shared)
|
|
|
|
set(MONGOC_LIBRARIES mongo::mongoc_shared)
|
|
|
|
diff --git a/build/cmake/libmongoc-static-1.0-config.cmake.in b/build/cmake/libmongoc-static-1.0-config.cmake.in
|
|
|
|
index bec3163..a32d5f3 100644
|
|
|
|
--- a/build/cmake/libmongoc-static-1.0-config.cmake.in
|
|
|
|
+++ b/build/cmake/libmongoc-static-1.0-config.cmake.in
|
|
|
|
@@ -24,6 +24,9 @@ set (MONGOC_STATIC_VERSION_FULL @libmongoc_VERSION_FULL@)
|
|
|
|
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency (mongoc-1.0)
|
|
|
|
+if("@ENABLE_SNAPPY@" STREQUAL "ON")
|
|
|
|
+ find_dependency(Snappy CONFIG)
|
|
|
|
+endif()
|
|
|
|
|
|
|
|
set(MONGOC_STATIC_LIBRARY mongo::mongoc_static)
|
|
|
|
set(MONGOC_STATIC_LIBRARIES mongo::mongoc_static)
|
2022-11-03 05:39:31 +08:00
|
|
|
diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt
|
2023-11-17 08:52:43 +08:00
|
|
|
index 5f553c5..4675313 100644
|
2022-11-03 05:39:31 +08:00
|
|
|
--- a/src/libmongoc/CMakeLists.txt
|
|
|
|
+++ b/src/libmongoc/CMakeLists.txt
|
2023-11-17 08:52:43 +08:00
|
|
|
@@ -50,7 +50,7 @@ endif ()
|
2022-11-03 05:39:31 +08:00
|
|
|
set (ZLIB_INCLUDE_DIRS "")
|
|
|
|
if (ENABLE_ZLIB MATCHES "SYSTEM|AUTO")
|
|
|
|
message (STATUS "Searching for zlib CMake packages")
|
|
|
|
- include (FindZLIB)
|
|
|
|
+ find_package(ZLIB REQUIRED)
|
|
|
|
if (ZLIB_FOUND)
|
2023-08-18 03:56:00 +08:00
|
|
|
message (STATUS " zlib found version \"${ZLIB_VERSION_STRING}\"")
|
|
|
|
message (STATUS " zlib include path \"${ZLIB_INCLUDE_DIRS}\"")
|
2023-11-17 08:52:43 +08:00
|
|
|
@@ -468,10 +468,10 @@ else ()
|
2022-11-03 05:39:31 +08:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Sets SNAPPY_LIBRARIES and SNAPPY_INCLUDE_DIRS.
|
|
|
|
-include (FindSnappy)
|
|
|
|
-if (SNAPPY_INCLUDE_DIRS)
|
|
|
|
+if(ENABLE_SNAPPY)
|
|
|
|
+ find_package(Snappy CONFIG REQUIRED)
|
|
|
|
+ set(SNAPPY_LIBRARIES Snappy::snappy)
|
|
|
|
set (MONGOC_ENABLE_COMPRESSION 1)
|
|
|
|
- include_directories ("${SNAPPY_INCLUDE_DIRS}")
|
|
|
|
endif ()
|
|
|
|
|
2023-11-17 08:52:43 +08:00
|
|
|
mongo_bool01 (MONGOC_ENABLE_SHM_COUNTERS ENABLE_SHM_COUNTERS)
|
2022-11-03 05:39:31 +08:00
|
|
|
diff --git a/src/libmongoc/src/mongoc-config.cmake b/src/libmongoc/src/mongoc-config.cmake
|
2023-11-17 08:52:43 +08:00
|
|
|
index 31e6cbc..365fb5b 100644
|
2022-11-03 05:39:31 +08:00
|
|
|
--- a/src/libmongoc/src/mongoc-config.cmake
|
|
|
|
+++ b/src/libmongoc/src/mongoc-config.cmake
|
2023-11-17 08:52:43 +08:00
|
|
|
@@ -1,5 +1,8 @@
|
2022-11-03 05:39:31 +08:00
|
|
|
include(CMakeFindDependencyMacro)
|
2023-11-17 08:52:43 +08:00
|
|
|
find_dependency(bson-1.0 @libmongoc_VERSION@)
|
2022-11-03 05:39:31 +08:00
|
|
|
+if("@ENABLE_SNAPPY@" STREQUAL "ON")
|
|
|
|
+ find_dependency(Snappy CONFIG)
|
|
|
|
+endif()
|
2023-11-17 08:52:43 +08:00
|
|
|
|
|
|
|
# If we need to import a TLS package for our imported targets, do that now:
|
|
|
|
set(MONGOC_TLS_BACKEND [[@TLS_BACKEND@]])
|