[MONGOCRYPT-216] Fix installed cmake configuration files Created: 09/Dec/19  Updated: 28/Oct/23  Resolved: 10/Dec/19

Status: Closed
Project: Libmongocrypt
Component/s: C library
Affects Version/s: None
Fix Version/s: 1.0.1

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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).



 Comments   
Comment by Githook User [ 10/Dec/19 ]

Author:

{'name': 'Roberto C. Sánchez', 'username': 'rcsanchez97', 'email': 'roberto@connexer.com'}

Message: MONGOCRYPT-216 fix paths referenced in .deb CMake package scripts
Branch: master
https://github.com/mongodb/libmongocrypt/commit/6001e809cd36df59773448169d2eff59c93cac5d

Generated at Thu Feb 08 09:08:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.