@@ -6,11 +6,15 @@ pc files with getting clean linked libraries retrieved from the targets:
66https://gitlab.kitware.com/cmake/cmake/-/issues/22621
77
88Also 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
1215The following function is exposed:
1316
17+ ```cmake
1418pkgconfig_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
5462include_guard (GLOBAL )
0 commit comments