[MONGOCRYPT-110] libmongocrypt: add cmake package configuration Created: 21/Feb/19  Updated: 28/Oct/23  Resolved: 18/May/19

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

Type: Task Priority: Major - P3
Reporter: Kevin Albertson Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to MONGOCRYPT-140 Update kms_message exported CMake tar... Closed
Epic Link: Build libmongocrypt library

 Description   

The C driver will be a direct consumer of this libmongocrypt. The C driver will need to search and link against libmongocrypt if available.

To accomplish this, libmongocrypt needs to create CMake package configuration files on install, similar to what the C driver provides. That way, the C driver can find_package to check if libmongocrypt is installed and possibly link to it.

I don't think it's necessary to create package config files (though I may be wrong).

kms-message already has this: https://github.com/10gen/kms-message
Though I'm hesitant to copy over configuration without fully understanding it.



 Comments   
Comment by Githook User [ 18/May/19 ]

Author:

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

Message: CDRIVER-2973 improve mongocrypt CMake targets, add mongo:: namespace
Branch: master
https://github.com/10gen/libmongocrypt/commit/79c3b0a246c35fa1f12a21eabe5994c9444bc4e6

Comment by Githook User [ 18/May/19 ]

Author:

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

Message: CDRIVER-2973 build and execute static state machine example
Branch: master
https://github.com/10gen/libmongocrypt/commit/04c4fbeb3346d394a6040e6675bd74e58373a384

Comment by Kevin Albertson [ 03/May/19 ]

Noted in CDRIVER-2875 to consider using exported target (#4 in that list) for C driver integration.

Comment by Jeffrey Yemin [ 03/May/19 ]

Everything in the list in the previous comment except #4 will be done in the context of this ticket.

Comment by Roberto Sanchez [ 02/Apr/19 ]

Here is a summary of what remains for this task:

  • Replace the standard .cmake.in configuration template with a one-liner file containing a simple include directive (this is what is done in kms_message-config.cmake)
  • Mark the exportable targets in CMakeLists.txt
  • Tell CMake to actually install the exported targets (which creates and installs the file referenced by, e.g., kms_message-config.cmake), using the namespace 'mongo::'
  • Consider updating consumers to use the simpler mechanism made available by the exported targets
  • Rename the monocrypt-static target to mongocrypt_static for consistency with other libraries
Comment by Githook User [ 02/Apr/19 ]

Author:

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

Message: CDRIVER-2973 avoid include/lib leakage, use OpenSSL targets
Branch: master
https://github.com/10gen/libmongocrypt/commit/792e61377f87d2bd23ceca79b87ac81db7cecb59

Comment by Roberto Sanchez [ 30/Mar/19 ]

There are some limitations to the CMake package support that I implemented. After reviewing CXX-1707, it seems prudent to improve the CMake package support in libmongocrypt to also export targets as suggested in CXX-1707. It will make consuming libmongocrypt in other projects simpler and more straightforward.

Comment by Githook User [ 28/Mar/19 ]

Author:

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

Message: CDRIVER-2973 cmake and pkg-config package configurations
Branch: master
https://github.com/10gen/libmongocrypt/commit/0d8c96ca59fe42248b2e18be118866d88b2c218f

Comment by Githook User [ 27/Mar/19 ]

Author:

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

Message: CDRIVER-2973 install static library
Branch: master
https://github.com/10gen/libmongocrypt/commit/5df2a6c60f273c2e2e4335225cec56496021775a

Comment by Githook User [ 27/Mar/19 ]

Author:

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

Message: CDRIVER-2973 use GnuInstallDirs for better build flexibility
Branch: master
https://github.com/10gen/libmongocrypt/commit/10ff15110b721ff27967c36ad0c6c780e18c2af8

Comment by Githook User [ 19/Mar/19 ]

Author:

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

Message: CDRIVER-2973 dynamically link to libbson
Branch: master
https://github.com/10gen/libmongocrypt/commit/bbd2c62eaa0e855512c0e3d28b08ad8523764d4f

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