Skip to content

Commit d5081bc

Browse files
committed
build: vcpkg manifest example
1 parent 5ffc7de commit d5081bc

File tree

2 files changed

+57
-9
lines changed

2 files changed

+57
-9
lines changed

docs/modules/ROOT/pages/install.adoc

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ tar -xvf "duktape-2.7.0.tar.xz"
109109
Duktape provides no CMake integration scripts.
110110
The MrDocs configuration script needs direct access to the installed source files for Duktape so that's all you need to do.
111111

112-
==== VcPkg dependencies
112+
=== CMake dependencies
113113

114-
These other dependencies provide CMake integration scripts and can be obtained from https://www.vcpkg.io/[vcpkg] or installed manually.
115-
These instructions assume you are using VcPkg.
114+
All other dependencies provide CMake integration scripts and can be obtained from https://www.vcpkg.io/[vcpkg] or installed manually.
116115

117116
* `fmt` >= 10
118117
* `zlib`
@@ -121,38 +120,70 @@ For development builds, which include tests, you will also need:
121120

122121
* `libxml2[tools]`
123122

124-
To install these dependencies with VcPkg, first clone the repository:
123+
The instructions in this documentation will use vcpkg for these.
124+
125+
**Installing vcpkg**:
126+
127+
If you don't have vcpkg installed, clone the repository:
125128

126129
[source,bash]
127130
----
128131
git clone https://github.com/microsoft/vcpkg.git -b master
129132
cd vcpkg
130133
----
131134

132-
Then bootstrap it and install the required dependencies:
135+
and bootstrap it:
133136

134137
Windows:
135138

136139
[source,bash]
137140
----
138141
bootstrap-vcpkg.bat
139-
vcpkg.exe fmt zlib libxml2[tools] --triplet x64-windows
140142
----
141143

142144
Unix variants:
143145

144146
[source,bash]
145147
----
146148
./bootstrap-vcpkg.sh
147-
./vcpkg fmt zlib libxml2[tools]
148149
----
149150

150-
Return from `./third-party/vcpkg` to the parent directory of `third-party` (the one containing the `mrdocs` directory) to build and install MrDocs:
151+
**Installing dependencies**:
152+
153+
vcpkg has two operation modes with which you can install these dependencies: <<vcpkg-classic-mode,classic mode>> and <<vcpkg-manifest-mode,manifest mode>>.
154+
155+
[#vcpkg-classic-mode]
156+
_Classic mode_:
157+
158+
In vcpkg @https://learn.microsoft.com/en-us/vcpkg/users/classic-mode[classic mode,window=blank_], vcpkg maintains a central installed tree inside the vcpkg instance built up by individual vcpkg install and vcpkg remove commands.
159+
This central set of packages can then be shared by any number of projects.
160+
However, each instance of vcpkg (a separate git clone) will have its own set of packages installed.
161+
162+
To install these dependencies with vcpkg in classic mode:
163+
164+
Windows:
151165

152166
[source,bash]
153167
----
154-
cd ../..
168+
vcpkg.exe fmt zlib libxml2[tools] --triplet x64-windows
169+
----
170+
171+
Unix variants:
172+
173+
[source,bash]
155174
----
175+
./vcpkg fmt zlib libxml2[tools]
176+
----
177+
178+
[#vcpkg-manifest-mode]
179+
_Manifest mode_:
180+
181+
In @https://learn.microsoft.com/en-us/vcpkg/users/manifests[manifest mode,windows=blank_], you declare your project's direct dependencies in a manifest file named `vcpkg.json`.
182+
MrDocs includes a `vcpkg.json.example` file you can duplicate or create a symlink as `vcpkg.json` to use this mode.
183+
MrDocs is a CMake project that then already includes a `vcpkg.json` file, there's nothing else you need to run to install the dependencies.
184+
185+
In this mode, vcpkg will create separate installed trees for each project and configuration.
186+
This is the recommended vcpkg mode for most users according to the @https://learn.microsoft.com/en-us/vcpkg/users/manifests[vcpkg documentation,window=blank_].
156187

157188
=== MrDocs
158189

vcpkg.json.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "mrdocs",
3+
"version": "0.1.0",
4+
"dependencies": [
5+
{
6+
"name": "fmt",
7+
"version>=": "10.0.0"
8+
},
9+
{
10+
"name": "libxml2",
11+
"features": [
12+
"tools"
13+
]
14+
}
15+
],
16+
"builtin-baseline": "3715d743ac08146d9b7714085c1babdba9f262d5"
17+
}

0 commit comments

Comments
 (0)