Skip to content

Commit f9ce644

Browse files
committed
Update docs
1 parent 9909551 commit f9ce644

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+645
-866
lines changed

bin/make-docs.php

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@
88
* ./bin/make-docs.php
99
*/
1010

11+
/**
12+
* Get CMake module header content.
13+
*/
14+
function generateModuleDocs(
15+
string $file,
16+
string $namespace,
17+
string $destination
18+
): void {
19+
$content = file_get_contents($file);
20+
preg_match('/^#\[===+\[\s*(.*?)\s*#\]===+\]/s', $content, $matches);
21+
22+
if (isset($matches[1])) {
23+
$moduleName = basename($file, '.cmake');
24+
25+
$content = '';
26+
$content .= "# $namespace" . "$moduleName\n\n";
27+
$content .= $matches[1];
28+
$content .= "\n";
29+
30+
if (!file_exists($destination . '/' . $namespace)) {
31+
mkdir($destination . '/' . $namespace, 0777, true);
32+
}
33+
34+
file_put_contents(
35+
$destination . '/' . $namespace . $moduleName . '.md',
36+
$content
37+
);
38+
}
39+
}
40+
1141
$docs = __DIR__ . '/../docs/cmake-modules';
1242
if (!file_exists($docs)) {
1343
mkdir($docs, 0777, true);
@@ -27,23 +57,15 @@
2757
$relativeFilename = trim(str_replace($modulesDirectory, '', $file), '/');
2858
echo "Processing " . $relativeFilename . "\n";
2959

30-
$content = file_get_contents($file);
31-
preg_match('/^#\[===+\[\s*(.*?)\s*#\]===+\]/s', $content, $matches);
32-
33-
if (isset($matches[1])) {
34-
$moduleName = basename($file, '.cmake');
35-
$namespace = trim(str_replace($modulesDirectory, '', dirname($file)), '/');
36-
$namespace = ($namespace == '') ? '' : $namespace . '/';
37-
38-
$content = '';
39-
$content .= "# $namespace" . "$moduleName\n\n";
40-
$content .= $matches[1];
41-
$content .= "\n";
60+
$namespace = trim(str_replace($modulesDirectory, '', dirname($file)), '/');
61+
$namespace = ($namespace == '') ? '' : $namespace . '/';
4262

43-
if (!file_exists($docs . '/' . $namespace)) {
44-
mkdir($docs . '/' . $namespace, 0777, true);
45-
}
46-
47-
file_put_contents($docs . '/' . $namespace . $moduleName . '.md', $content);
48-
}
63+
generateModuleDocs($file, $namespace, $docs);
4964
}
65+
66+
// Add ext/skeleton/cmake/modules/FindPHP.cmake.
67+
generateModuleDocs(
68+
__DIR__ . '/../cmake/ext/skeleton/cmake/modules/FindPHP.cmake',
69+
'',
70+
$docs
71+
);

docs/cmake-modules/FindACL.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,28 @@
22

33
Find the ACL library.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
ACL::ACL
8-
The package library, if found.
7+
* `ACL::ACL` - The package library, if found.
98

109
Result variables:
1110

12-
ACL_FOUND
13-
Whether the package has been found.
14-
ACL_INCLUDE_DIRS
15-
Include directories needed to use this package.
16-
ACL_LIBRARIES
17-
Libraries needed to link to the package library.
18-
ACL_VERSION
19-
Package version, if found.
11+
* `ACL_FOUND` - Whether the package has been found.
12+
* `ACL_INCLUDE_DIRS` - Include directories needed to use this package.
13+
* `ACL_LIBRARIES` - Libraries needed to link to the package library.
14+
* `ACL_VERSION` - Package version, if found.
2015

2116
Cache variables:
2217

23-
ACL_IS_BUILT_IN
24-
Whether ACL is a part of the C library (BSD-based systems).
25-
ACL_INCLUDE_DIR
26-
Directory containing package library headers.
27-
ACL_LIBRARY
28-
The path to the package library.
18+
* `ACL_IS_BUILT_IN` - Whether ACL is a part of the C library (BSD-based
19+
systems).
20+
* `ACL_INCLUDE_DIR` - Directory containing package library headers.
21+
* `ACL_LIBRARY` - The path to the package library.
2922

3023
Hints:
3124

32-
The ACL_ROOT variable adds custom search path.
25+
The `ACL_ROOT` variable adds custom search path.
3326

34-
Set ACL_USE_USER_GROUP to TRUE before calling find_package(ACL) to also check
35-
if the ACL library supports ACL_USER and ACL_GROUP. For example, macOS doesn't
36-
have support for user/group.
27+
Set `ACL_USE_USER_GROUP` to `TRUE` before calling `find_package(ACL)` to also
28+
check if the ACL library supports `ACL_USER` and `ACL_GROUP`. For example, macOS
29+
doesn't have support for user/group.

docs/cmake-modules/FindApache.md

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,40 @@
22

33
Find the Apache packages and tools.
44

5-
The Apache development package usually contains Apache header files, the apr
6-
(Apache Portable Runtime) library and its headers, apr config command-line tool,
7-
and the apxs command-line tool.
5+
The Apache development package usually contains Apache header files, the `apr`
6+
(Apache Portable Runtime) library and its headers, `apr` config command-line
7+
tool, and the `apxs` command-line tool.
88

9-
Module defines the following IMPORTED target(s):
9+
Module defines the following `IMPORTED` target(s):
1010

11-
Apache::Apache
12-
The package library, if found.
11+
* `Apache::Apache` - The package library, if found.
1312

1413
Result variables:
1514

16-
Apache_FOUND
17-
Whether the package has been found.
18-
Apache_INCLUDE_DIRS
19-
Include directories needed to use this package.
20-
Apache_LIBRARIES
21-
Libraries needed to link to the package library.
22-
Apache_VERSION
23-
Package version, if found.
24-
Apache_THREADED
25-
Whether Apache requires thread safety.
26-
Apache_LIBEXECDIR
27-
Path to the directory containing all Apache modules and httpd.exp file (list
28-
of exported symbols).
15+
* `Apache_FOUND` - Whether the package has been found.
16+
* `Apache_INCLUDE_DIRS` - Include directories needed to use this package.
17+
* `Apache_LIBRARIES` - Libraries needed to link to the package library.
18+
* `Apache_VERSION` - Package version, if found.
19+
* `Apache_THREADED` - Whether Apache requires thread safety.
20+
* `Apache_LIBEXECDIR` - Path to the directory containing all Apache modules and
21+
`httpd.exp` file (list of exported symbols).
2922

3023
Cache variables:
3124

32-
Apache_APXS_EXECUTABLE
33-
Path to the APache eXtenSion tool command-line tool.
34-
Apache_APXS_DEFINITIONS
35-
A list of compile definitions (-D) from the apxs CFLAGS query string.
36-
Apache_APR_CONFIG_EXECUTABLE
37-
Path to the apr library command-line configuration tool.
38-
Apache_APR_CPPFLAGS
39-
A list of C preprocessor flags for the APR library.
40-
Apache_APU_CONFIG_EXECUTABLE
41-
Path to the Apache Portable Runtime Utilities config command-line tool.
42-
Apache_EXECUTABLE
43-
Path to the Apache command-line server program.
44-
Apache_INCLUDE_DIR
45-
Directory containing package library headers.
46-
Apache_APR_INCLUDE_DIR
47-
Directory containing apr library headers.
48-
Apache_APR_LIBRARY
49-
The path to the apr library.
25+
* `Apache_APXS_EXECUTABLE` - Path to the APache eXtenSion tool command-line tool
26+
(`apxs`).
27+
* `Apache_APXS_DEFINITIONS` - A list of compile definitions (`-D`) from the
28+
`apxs -q CFLAGS` query string.
29+
* `Apache_APR_CONFIG_EXECUTABLE` - Path to the `apr` library command-line
30+
configuration tool.
31+
* `Apache_APR_CPPFLAGS` - A list of C preprocessor flags for the `apr` library.
32+
* `Apache_APU_CONFIG_EXECUTABLE` - Path to the Apache Portable Runtime Utilities
33+
config command-line tool.
34+
* `Apache_EXECUTABLE` - Path to the Apache command-line server program.
35+
* `Apache_INCLUDE_DIR` - Directory containing package library headers.
36+
* `Apache_APR_INCLUDE_DIR` - Directory containing `apr` library headers.
37+
* `Apache_APR_LIBRARY` - The path to the `apr` library.
5038

5139
Hints:
5240

53-
The Apache_ROOT variable adds custom search path.
41+
The `Apache_ROOT` variable adds custom search path.

docs/cmake-modules/FindAppArmor.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22

33
Find the AppArmor library.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
AppArmor::AppArmor
8-
The package library, if found.
7+
* `AppArmor::AppArmor` - The package library, if found.
98

109
Result variables:
1110

12-
AppArmor_FOUND
13-
Whether the package has been found.
14-
AppArmor_INCLUDE_DIRS
15-
Include directories needed to use this package.
16-
AppArmor_LIBRARIES
17-
Libraries needed to link to the package library.
18-
AppArmor_VERSION
19-
Package version, if found.
11+
* `AppArmor_FOUND` - Whether the package has been found.
12+
* `AppArmor_INCLUDE_DIRS` - Include directories needed to use this package.
13+
* `AppArmor_LIBRARIES` - Libraries needed to link to the package library.
14+
* `AppArmor_VERSION` - Package version, if found.
2015

2116
Cache variables:
2217

23-
AppArmor_INCLUDE_DIR
24-
Directory containing package library headers.
25-
AppArmor_LIBRARY
26-
The path to the package library.
18+
* `AppArmor_INCLUDE_DIR` - Directory containing package library headers.
19+
* `AppArmor_LIBRARY` - The path to the package library.
2720

2821
Hints:
2922

30-
The AppArmor_ROOT variable adds custom search path.
23+
The `AppArmor_ROOT` variable adds custom search path.

docs/cmake-modules/FindArgon2.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22

33
Find the Argon2 library.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
Argon2::Argon2
8-
The package library, if found.
7+
* `Argon2::Argon2` - The package library, if found.
98

109
Result variables:
1110

12-
Argon2_FOUND
13-
Whether the package has been found.
14-
Argon2_INCLUDE_DIRS
15-
Include directories needed to use this package.
16-
Argon2_LIBRARIES
17-
Libraries needed to link to the package library.
18-
Argon2_VERSION
19-
Package version, if found.
11+
* `Argon2_FOUND` - Whether the package has been found.
12+
* `Argon2_INCLUDE_DIRS` - Include directories needed to use this package.
13+
* `Argon2_LIBRARIES` - Libraries needed to link to the package library.
14+
* `Argon2_VERSION` - Package version, if found.
2015

2116
Cache variables:
2217

23-
Argon2_INCLUDE_DIR
24-
Directory containing package library headers.
25-
Argon2_LIBRARY
26-
The path to the package library.
18+
* `Argon2_INCLUDE_DIR` - Directory containing package library headers.
19+
* `Argon2_LIBRARY` - The path to the package library.
2720

2821
Hints:
2922

30-
The Argon2_ROOT variable adds custom search path.
23+
The `Argon2_ROOT` variable adds custom search path.

docs/cmake-modules/FindAtomic.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
Find the atomic instructions.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
Atomic::Atomic
8-
The Atomic library, if found.
7+
* `Atomic::Atomic` - The Atomic library, if found.
98

109
Result variables:
1110

12-
Atomic_FOUND
13-
Whether atomic instructions are available.
14-
Atomic_LIBRARIES
15-
A list of libraries needed in order to use atomic functionality.
11+
* `Atomic_FOUND` - Whether atomic instructions are available.
12+
* `Atomic_LIBRARIES` - A list of libraries needed in order to use atomic
13+
functionality.

docs/cmake-modules/FindBerkeleyDB.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,29 @@
22

33
Find the Berkeley DB library.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
BerkeleyDB::BerkeleyDB
8-
The package library, if found.
7+
* `BerkeleyDB::BerkeleyDB` - The package library, if found.
98

109
Result variables:
1110

12-
BerkeleyDB_FOUND
11+
`BerkeleyDB_FOUND`
1312
Whether the package has been found.
14-
BerkeleyDB_INCLUDE_DIRS
13+
`BerkeleyDB_INCLUDE_DIRS`
1514
Include directories needed to use this package.
16-
BerkeleyDB_LIBRARIES
15+
`BerkeleyDB_LIBRARIES`
1716
Libraries needed to link to the package library.
1817

1918
Cache variables:
2019

21-
BerkeleyDB_INCLUDE_DIR
22-
Directory containing package library headers.
23-
BerkeleyDB_LIBRARY
24-
The path to the package library.
25-
BerkeleyDB_DB1_INCLUDE_DIR
26-
Directory containing headers for DB1 emulation support in Berkeley DB.
20+
* `BerkeleyDB_INCLUDE_DIR` - Directory containing package library headers.
21+
* `BerkeleyDB_LIBRARY` - The path to the package library.
22+
* `BerkeleyDB_DB1_INCLUDE_DIR` - Directory containing headers for DB1 emulation
23+
support in Berkeley DB.
2724

2825
Hints:
2926

30-
The BerkeleyDB_ROOT variable adds custom search path.
27+
The `BerkeleyDB_ROOT` variable adds custom search path.
3128

32-
Set BerkeleyDB_USE_DB1 to TRUE before calling find_package(BerkeleyDB) to
33-
enable the Berkeley DB 1.x support/emulation.
29+
Set `BerkeleyDB_USE_DB1` to `TRUE` before calling `find_package(BerkeleyDB)` to
30+
enable the Berkeley DB 1.x support/emulation.

docs/cmake-modules/FindCapstone.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22

33
Find the Capstone library.
44

5-
Module defines the following IMPORTED target(s):
5+
Module defines the following `IMPORTED` target(s):
66

7-
Capstone::Capstone
8-
The package library, if found.
7+
* `Capstone::Capstone` - The package library, if found.
98

109
Result variables:
1110

12-
Capstone_FOUND
13-
Whether the package has been found.
14-
Capstone_INCLUDE_DIRS
15-
Include directories needed to use this package.
16-
Capstone_LIBRARIES
17-
Libraries needed to link to the package library.
18-
Capstone_VERSION
19-
Package version, if found.
11+
* `Capstone_FOUND` - Whether the package has been found.
12+
* `Capstone_INCLUDE_DIRS` - Include directories needed to use this package.
13+
* `Capstone_LIBRARIES` - Libraries needed to link to the package library.
14+
* `Capstone_VERSION` - Package version, if found.
2015

2116
Cache variables:
2217

23-
Capstone_INCLUDE_DIR
24-
Directory containing package library headers.
25-
Capstone_LIBRARY
26-
The path to the package library.
18+
* `Capstone_INCLUDE_DIR` - Directory containing package library headers.
19+
* `Capstone_LIBRARY` - The path to the package library.
2720

2821
Hints:
2922

30-
The Capstone_ROOT variable adds custom search path.
23+
The `Capstone_ROOT` variable adds custom search path.

0 commit comments

Comments
 (0)