Skip to content

Commit 1056de5

Browse files
committed
find the libbson include directory in a more robust way
1 parent 7cbc07a commit 1056de5

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
cmake/ImportBSON.cmake | 4 +++-
3+
1 file changed, 3 insertions(+), 1 deletion(-)
4+
5+
--- a/cmake/ImportBSON.cmake
6+
+++ b/cmake/ImportBSON.cmake
7+
@@ -75,7 +75,9 @@
8+
message (STATUS "NOTE: Using system-wide libbson library. This is intended only for package maintainers.")
9+
find_library (_MONGOCRYPT_SYSTEM_LIBBSON_SHARED "${CMAKE_SHARED_LIBRARY_PREFIX}bson2${CMAKE_SHARED_LIBRARY_SUFFIX}")
10+
find_library (_MONGOCRYPT_SYSTEM_LIBBSON_STATIC "${CMAKE_STATIC_LIBRARY_PREFIX}bson2${CMAKE_STATIC_LIBRARY_SUFFIX}")
11+
- find_path (_MONGOCRYPT_SYSTEM_LIBBSON_INCLUDE_DIR bson/bson.h PATH_SUFFIXES bson-2.1.0)
12+
+ find_package (bson 2.0 REQUIRED)
13+
+ get_target_property (_BSON_SHARED_INCL_DIR_PROP bson::shared INTERFACE_INCLUDE_DIRECTORIES)
14+
+ set (_MONGOCRYPT_SYSTEM_LIBBSON_INCLUDE_DIR "${_BSON_SHARED_INCL_DIR_PROP}" CACHE FILEPATH "Internal use only")
15+
add_library (bson_shared SHARED IMPORTED)
16+
add_library (bson_static STATIC IMPORTED)
17+
set_target_properties (bson_shared bson_static PROPERTIES

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bson-include-dir-search.patch

0 commit comments

Comments
 (0)