[CXX-1073] Automatically add CMAKE_INSTALL_PREFIX/lib/pkgconfig to PKG_CONFIG_PATH when appropriate Created: 07/Oct/16  Updated: 14/Apr/17  Resolved: 14/Apr/17

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Backlog - CXX Driver Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Many users seem to have difficulty understanding that if they have installed the C driver to a given $prefix that is not among those prefixes that are automatically searched by pkgconfig, that they must set PKG_CONFIG_PATH to $prefix/lib/pkgconfig.

In most cases, users are installing both the C driver and the C++ driver to the same $prefix.

Perhaps we should automatically add CMAKE_INSTALL_PREFIX/lib/pkgconfig to the PKG_CONFIG_PATH in the environment.

In particular, I would do this if:

  • There is no PKG_CONFIG_PATH set in the environment when CMake is invoked (i.e. don't mess with it if the user set it)
  • The user has customized CMAKE_INSTALL_PREFIX when invoking the C++ driver CMake (so they are asking to install somewhere other than the default build/install).
  • The user has not set LIBBSON_DIR and LIBMONGOC_DIR.

That seems pretty safe to do, and might stop a lot of the "my C++ driver build can't find the C driver" sort of tickets or user group posts.



 Comments   
Comment by David Golden [ 14/Apr/17 ]

When libmongoc and libbson publish .cmake files in 1.7.0, and we release 3.2.0 to use those, then this won't be necessary any more.

Generated at Wed Feb 07 22:01:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.