-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.16.0
-
Component/s: None
-
None
Currently, building and installing libmongoc results in a cmake targets file (lib/cmake/mongoc-1.0/mongoc-targets.cmake) with these lines:
# Create imported target mongo::mongoc_sharedadd_library(mongo::mongoc_shared SHARED IMPORTED) set_target_properties(mongo::mongoc_shared PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/libmongoc-1.0" INTERFACE_LINK_LIBRARIES "mongo::bson_shared") # Create imported target mongo::mongoc_static add_library(mongo::mongoc_static STATIC IMPORTED) set_target_properties(mongo::mongoc_static PROPERTIES INTERFACE_COMPILE_DEFINITIONS "MONGOC_STATIC;BSON_STATIC" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/libmongoc-1.0" INTERFACE_LINK_LIBRARIES "/usr/lib/libsasl2.dylib;-framework CoreFoundation -framework Security;resolv;/usr/local/lib/libsnappy.dylib;/usr/lib/libz.dylib;/usr/local/lib/libzstd.dylib;/usr/local/Cellar/icu4c/64.2/lib/libicuuc.dylib;mongo::mongocrypt;mongo::bson_static")
The listing of mongo::mongocrypt is the cmake target name of libmongocrypt. Instead, I believe it should be the path to the libmongocrypt.dylib (or .so/.dll).
As a workaround, consumers can explicitly find_package(mongocrypt) when linking to mongoc_static.