Skip to content

Commit 3bc0994

Browse files
committed
Use Markdown in CMake module headers
For now Markdown is picked due to its syntax simplicity but can be replaced in the future with RST if such need comes. Module headers are parsed by script and Markdown files are generated for easier documentation reading.
1 parent 83fffb3 commit 3bc0994

File tree

2 files changed

+58
-45
lines changed

2 files changed

+58
-45
lines changed

cmake/cmake/modules/PHP/ConfigureFile.cmake

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@
22
Wrapper built on top of CMake's configure_file().
33
44
There is a common issue with installation prefix not being applied when using
5-
--prefix command line option at the installation phase:
6-
cmake --install <build-dir> --prefix <prefix>
5+
`--prefix` command-line option at the installation phase:
6+
7+
```sh
8+
cmake --install <build-dir> --prefix <prefix>
9+
```
710
811
The following function is exposed:
912
13+
```cmake
1014
php_configure_file(
1115
<template-file>
1216
<file-output>
1317
[INSTALL_DESTINATION <path>]
1418
[VARIABLES [<variable> <value>] ...]
1519
)
16-
17-
INSTALL_DESTINATION
18-
Path to the directory where the generated file <file-output> will be
19-
installed to. If not provided, <file-output> will not be installed.
20-
VARIABLES
21-
Pairs of variable names and values.
22-
23-
The $<INSTALL_PREFIX> generator expression can be used in variable values,
24-
which is replaced with installation prefix either set via the
25-
CMAKE_INSTALL_PREFIX variable at the configuration phase, or the
26-
'--prefix' option at the 'cmake --install' phase.
20+
```
21+
22+
* `INSTALL_DESTINATION`
23+
Path to the directory where the generated file `<file-output>` will be
24+
installed to. If not provided, `<file-output>` will not be installed.
25+
* `VARIABLES`
26+
Pairs of variable names and values.
27+
28+
The `$<INSTALL_PREFIX>` generator expression can be used in variable values,
29+
which is replaced with installation prefix either set via the
30+
`CMAKE_INSTALL_PREFIX` variable at the configuration phase, or the `--prefix`
31+
option at the `cmake --install` phase.
2732
#]=============================================================================]
2833

2934
include_guard(GLOBAL)

cmake/cmake/modules/PHP/PkgConfigGenerator.cmake

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ pc files with getting clean linked libraries retrieved from the targets:
66
https://gitlab.kitware.com/cmake/cmake/-/issues/22621
77
88
Also there is a common issue with installation prefix not being applied when
9-
using --prefix command line option at the installation phase:
10-
cmake --install <build-dir> --prefix <prefix>
9+
using `--prefix` command-line option at the installation phase:
10+
11+
```sh
12+
cmake --install <build-dir> --prefix <prefix>
13+
```
1114
1215
The following function is exposed:
1316
17+
```cmake
1418
pkgconfig_generate_pc(
1519
<pc-template-file>
1620
<pc-file-output>
@@ -19,36 +23,40 @@ pkgconfig_generate_pc(
1923
[VARIABLES [<variable> <value>] [<variable_2>:BOOL <value_2>...] ...]
2024
[SKIP_BOOL_NORMALIZATION]
2125
)
22-
23-
Generate pkgconfig <pc-file-output> from the given pc <pc-template-file>
24-
template.
25-
26-
TARGET
27-
Name of the target for getting libraries.
28-
INSTALL_DESTINATION
29-
Path to the pkgconfig directory where generated .pc file will be installed
30-
to. Usually it is '${CMAKE_INSTALL_LIBDIR}/pkgconfig'. If not provided, .pc
31-
file will not be installed.
32-
VARIABLES
33-
Pairs of variable names and values. To pass booleans, append ':BOOL' to the
34-
variable name. For example:
35-
pkgconfig_generate_pc(
36-
...
37-
VARIABLES
38-
variable_name:BOOL "${variable_name}"
39-
)
40-
41-
The $<INSTALL_PREFIX> generator expression can be used in variable values,
42-
which is replaced with installation prefix either set via the
43-
CMAKE_INSTALL_PREFIX variable at the configuration phase, or the
44-
'--prefix' option at the 'cmake --install' phase.
45-
46-
SKIP_BOOL_NORMALIZATION
47-
CMake booleans have values yes, no, true, false, on, off, 1, 0, they can
48-
even be case insensitive and so on. By default, all booleans (var:BOOL see
49-
above) are normalized to values "yes" or "no". If this option is given,
50-
boolean values are replaced in .pc template with the CMake format instead
51-
(they will be replaced to 'ON' or 'OFF' and similar).
26+
```
27+
28+
Generate pkgconfig `<pc-file-output>` from the given pc `<pc-template-file>`
29+
template.
30+
31+
* `TARGET`
32+
Name of the target for getting libraries.
33+
* `INSTALL_DESTINATION`
34+
Path to the pkgconfig directory where generated .pc file will be installed to.
35+
Usually it is `${CMAKE_INSTALL_LIBDIR}/pkgconfig`. If not provided, .pc file
36+
will not be installed.
37+
* `VARIABLES`
38+
Pairs of variable names and values. To pass booleans, append ':BOOL' to the
39+
variable name. For example:
40+
41+
```cmake
42+
pkgconfig_generate_pc(
43+
...
44+
VARIABLES
45+
variable_name:BOOL "${variable_name}"
46+
)
47+
```
48+
49+
The `$<INSTALL_PREFIX>` generator expression can be used in variable values,
50+
which is replaced with installation prefix either set via the
51+
`CMAKE_INSTALL_PREFIX` variable at the configuration phase, or the `--prefix`
52+
option at the `cmake --install` phase.
53+
54+
* `SKIP_BOOL_NORMALIZATION`
55+
CMake booleans have values `yes`, `no`, `true`, `false`, `on`, `off`, `1`,
56+
`0`, they can even be case insensitive and so on. By default, all booleans
57+
(`var:BOOL`, see above) are normalized to values `yes` or `no`. If this option
58+
is given, boolean values are replaced in .pc template with the CMake format
59+
instead (they will be replaced to `ON` or `OFF` and similar).
5260
#]=============================================================================]
5361

5462
include_guard(GLOBAL)

0 commit comments

Comments
 (0)