Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3493

libmongocrypt not listed correctly as interface library for mongoc_static

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.16.1
    • Affects Version/s: 1.16.0
    • Component/s: None
    • Labels:
      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.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: