-
Notifications
You must be signed in to change notification settings - Fork 543
As requested, add detailed installation instructions for Vcpkg and Conan #1031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
7fcd550
9001d14
57bcd77
3ea4baa
3956939
464c600
cc23e0f
513679b
00f9ce5
e52e08d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,93 @@ To configure and install the driver, follow the instructions for your platform: | |
The Mongo C++ driver is available in the following package managers. | ||
- [Vcpkg](https://vcpkg.io/) (search for mongo-cxx-driver) | ||
- [Conan](https://conan.io/center/recipes/mongo-cxx-driver) | ||
- [Homebrew](https://formulae.brew.sh/formula/mongo-cxx-driver) | ||
|
||
### Vcpkg Install Instructions | ||
|
||
If you do not already have Vcpkg installed, install it with the following | ||
command: | ||
``` | ||
$ git clone https://github.com/Microsoft/vcpkg.git | ||
$ cd vcpkg | ||
$ ./bootstrap-vcpkg.sh | ||
``` | ||
|
||
Optionally, to install with Visual Studio integration: | ||
``` | ||
vcpkg integrate install | ||
``` | ||
|
||
Install the driver. (You may need to `git pull` to get the latest version of the | ||
driver) | ||
``` | ||
$ ./vcpkg install mongo-cxx-driver | ||
``` | ||
|
||
You can use the toolchain file, `vcpkg.cmake`, to instruct CMake where to find | ||
the development files, for example: | ||
``` | ||
-DCMAKE_TOOLCHAIN_FILE=/<path to vcpkg repo>/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
``` | ||
|
||
You can find the header files in: | ||
``` | ||
vcpkg/installed/<CPU ARCHITECTURE>-<OPERATING SYSTEM>/include/ | ||
``` | ||
|
||
The library files are in: | ||
``` | ||
vcpkg/installed/<CPU ARCHITECTURE>-<OPERATING SYSTEM>/lib/ | ||
``` | ||
Comment on lines
+67
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vcpkg recommends using the |
||
|
||
### Conan Install Instructions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include an up-front notice hat the package specifier is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I added the following line for the Conan documentation, but since Vcpkg handles versioning entirely through git, what is your recommendation for Vcpkg?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For vcpkg, just the package name is enough for anyone to get started quickly. Maybe leave a note that the version may be out of date on older vcpkg versions. |
||
|
||
Package Specifier: `mongo-cxx-driver/3.8.0` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3.8.1 is now available (as of yesterday) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I currently have a PR open with Conan to update their version to 3.8.1. I'll update the version in the instructions once it gets merged: conan-io/conan-center-index#20504 |
||
|
||
If you do not already have Conan installed, then install it and run the Conan | ||
initalization command below: | ||
``` | ||
$ pip install conan | ||
$ conan profile detect --force | ||
kevinAlbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
Add the following to your `conanfile.txt` | ||
``` | ||
[requires] | ||
mongo-cxx-driver/3.8.0 | ||
[generators] | ||
CMakeDeps | ||
CMakeToolchain | ||
``` | ||
|
||
Install the driver via Conan, and build your project: | ||
``` | ||
$ conan install conanfile.txt --output-folder=build --build=missing | ||
$ cmake \ | ||
-B build \ | ||
-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \ | ||
-DCMAKE_BUILD_TYPE=Release | ||
$ cmake --build build | ||
``` | ||
|
||
### Homebrew | ||
|
||
For MacOS users, homebrew is a convienent way to install the C++ driver. | ||
|
||
``` | ||
brew install mongo-cxx-driver | ||
``` | ||
|
||
Headers can be found in: | ||
``` | ||
/opt/homebrew/include/mongocxx/v_noabi/ | ||
/opt/homebrew/include/bsoncxx/v_noabi/ | ||
``` | ||
|
||
Library files can be found in: | ||
``` | ||
/opt/homebrew/lib/ | ||
bisht2050 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
## Docker Image | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.