Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-216

Fix installed cmake configuration files

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0.1
    • Affects Version/s: None
    • Component/s: C library
    • None

      The cmake package files installed don't appear to work (at least on Ubuntu 16.04, as they reference the wrong directory for where the library is installed).

      For a simple repro, install libmongocrypt per the Ubuntu instructions, and attempt to build a simple program with cmake.

      CMakeLists.txt:

      cmake_minimum_required (VERSION 3.1)
      message ("Searching for libmongocrypt")
      find_package (mongocrypt)
      add_executable(test test.c)
      target_link_libraries (test mongocrypt::mongocrypt)
      

      Output:

      cmake .
      Searching for libmongocrypt
      CMake Error at /usr/lib/x86_64-linux-gnu/cmake/mongocrypt/mongocrypt_targets.cmake:87 (message):
        The imported target "mongo::mongocrypt" references the file     "/usr/lib/lib/libmongocrypt.so.0.0.0"  but this file does not exist.  Possible reasons include:  * The file was deleted, renamed, or moved to another location.  * An install or uninstall procedure did not complete successfully.  * The installation package was faulty and contained     "/usr/lib/x86_64-linux-gnu/cmake/mongocrypt/mongocrypt_targets.cmake"  but not all the files it references.Call Stack (most recent call first):
        /usr/lib/x86_64-linux-gnu/cmake/mongocrypt/mongocrypt-config.cmake:1 (include)
        CMakeLists.txt:3 (find_package)
      -- Configuring incomplete, errors occurred!
      See also "/home/vagrant/test-link-against-libmongocrypt/CMakeFiles/CMakeOutput.log". 

      No drivers consume the cmake configuration files currently. Perhaps we should remove them for the time being, and add fix + add them back if we need them (while also adding linking tests per MONGOCRYPT-215).

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

              Created:
              Updated:
              Resolved: