Skip to content

Commit b726dc3

Browse files
committed
use standard install directories in main installation instructions
1 parent 5e1b46e commit b726dc3

File tree

2 files changed

+4
-77
lines changed

2 files changed

+4
-77
lines changed

docs/content/mongocxx-v3/installation/linux.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -101,55 +101,13 @@ cmake .. \
101101
-DCMAKE_INSTALL_PREFIX=/usr/local
102102
```
103103

104-
If installing to a non-standard directory (i.e., one which the dynamic loader does not search),
105-
consider specifying the `-DCMAKE_INSTALL_RPATH=` option. This may enable libmongocxx.so to locate
106-
libbsoncxx.so:
107-
108-
```
109-
cmake .. \
110-
-DCMAKE_BUILD_TYPE=Release \
111-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo \
112-
-DCMAKE_INSTALL_RPATH=$HOME/mongo/lib
113-
```
114-
115-
In the Unix examples that follow, `mongocxx` is customized in these ways:
116-
117-
* `libmongoc` is found in `$HOME/mongo-c-driver`.
118-
* `mongocxx` is to be installed into `$HOME/mongo-cxx-driver`.
119-
120-
With those two distinct (arbitrary) install locations, a user would run this `cmake` command:
121-
```sh
122-
cmake .. \
123-
-DCMAKE_BUILD_TYPE=Release \
124-
-DCMAKE_PREFIX_PATH=$HOME/mongo-c-driver \
125-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
126-
```
127-
128-
> *Note* If you need multiple paths in a CMake PATH variable, separate them with a semicolon like
129-
> this:
130-
> `-DCMAKE_PREFIX_PATH="/your/cdriver/prefix;/some/other/path"`
131-
132104
These options can be freely mixed with a C++17 polyfill option. For instance, this is how a user
133105
would run the command above with the Boost polyfill option:
134106
```sh
135107
cmake .. \
136108
-DCMAKE_BUILD_TYPE=Release \
137109
-DBSONCXX_POLY_USE_BOOST=1 \
138-
-DCMAKE_PREFIX_PATH=$HOME/mongo-c-driver \
139-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
140-
```
141-
142-
#### Configuring with `mongocxx` 3.1.x or 3.0.x
143-
144-
Instead of the `-DCMAKE_PREFIX_PATH` option, users must specify the `libmongoc` installation
145-
directory by using the `-DLIBMONGOC_DIR` and `-DLIBBSON_DIR` options:
146-
147-
```sh
148-
cmake .. \
149-
-DCMAKE_BUILD_TYPE=Release \
150-
-DLIBMONGOC_DIR=$HOME/mongo-c-driver \
151-
-DLIBBSON_DIR=$HOME/mongo-c-driver \
152-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
110+
-DCMAKE_INSTALL_PREFIX=/usr/local
153111
```
154112

155113
### Step 5: Build and install the driver
@@ -182,6 +140,6 @@ sudo cmake --build . --target uninstall
182140
Second, the uninstall script can be called:
183141

184142
```sh
185-
sudo $HOME/mongo-cxx-driver/share/mongo-cxx-driver/uninstall.sh
143+
sudo /usr/local/share/mongo-cxx-driver/uninstall.sh
186144
```
187145

docs/content/mongocxx-v3/installation/macos.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -101,44 +101,13 @@ cmake .. \
101101
-DCMAKE_INSTALL_PREFIX=/usr/local
102102
```
103103

104-
In the Unix examples that follow, `mongocxx` is customized in these ways:
105-
106-
* `libmongoc` is found in `$HOME/mongo-c-driver`.
107-
* `mongocxx` is to be installed into `$HOME/mongo-cxx-driver`.
108-
109-
With those two distinct (arbitrary) install locations, a user would run this `cmake` command:
110-
```sh
111-
cmake .. \
112-
-DCMAKE_BUILD_TYPE=Release \
113-
-DCMAKE_PREFIX_PATH=$HOME/mongo-c-driver \
114-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
115-
```
116-
117-
> *Note* If you need multiple paths in a CMake PATH variable, separate them with a semicolon like
118-
> this:
119-
> `-DCMAKE_PREFIX_PATH="/your/cdriver/prefix;/some/other/path"`
120-
121104
These options can be freely mixed with a C++17 polyfill option. For instance, this is how a user
122105
would run the command above with the Boost polyfill option:
123106
```sh
124107
cmake .. \
125108
-DCMAKE_BUILD_TYPE=Release \
126109
-DBSONCXX_POLY_USE_BOOST=1 \
127-
-DCMAKE_PREFIX_PATH=$HOME/mongo-c-driver \
128-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
129-
```
130-
131-
#### Configuring with `mongocxx` 3.1.x or 3.0.x
132-
133-
Instead of the `-DCMAKE_PREFIX_PATH` option, users must specify the `libmongoc` installation
134-
directory by using the `-DLIBMONGOC_DIR` and `-DLIBBSON_DIR` options:
135-
136-
```sh
137-
cmake .. \
138-
-DCMAKE_BUILD_TYPE=Release \
139-
-DLIBMONGOC_DIR=$HOME/mongo-c-driver \
140-
-DLIBBSON_DIR=$HOME/mongo-c-driver \
141-
-DCMAKE_INSTALL_PREFIX=$HOME/mongo-cxx-driver
110+
-DCMAKE_INSTALL_PREFIX=/usr/local
142111
```
143112

144113
### Step 5: Build and install the driver
@@ -171,6 +140,6 @@ sudo cmake --build . --target uninstall
171140
Second, the uninstall script can be called:
172141

173142
```sh
174-
sudo $HOME/mongo-cxx-driver/share/mongo-cxx-driver/uninstall.sh
143+
sudo /usr/local/share/mongo-cxx-driver/uninstall.sh
175144
```
176145

0 commit comments

Comments
 (0)