Skip to content

Commit 715823f

Browse files
committed
Fix find_package() modules docs
1 parent 6130605 commit 715823f

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

+60
-55
lines changed

bin/make-docs.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function generateModuleDocs(
2626
return;
2727
}
2828

29+
$header = $matches[1];
30+
2931
$moduleName = basename($file, '.cmake');
3032

3133
$content = '';
@@ -39,12 +41,15 @@ function generateModuleDocs(
3941
include({$namespace}{$moduleName})
4042
```
4143
EOT;
42-
} elseif (1 === preg_match('/^Find.+.cmake$/', $moduleName)) {
44+
} elseif (1 === preg_match('/^Find(.+)$/', $moduleName, $matches)) {
45+
if (isset($matches[1])) {
46+
$package = $matches[1];
47+
}
4348
$content .= <<<EOT
4449
## Basic usage
4550
4651
```cmake
47-
find_package($moduleName)
52+
find_package($package)
4853
```
4954
EOT;
5055
} else {
@@ -57,7 +62,7 @@ function generateModuleDocs(
5762
EOT;
5863
}
5964
$content .= "\n\n";
60-
$content .= $matches[1];
65+
$content .= $header;
6166
$content .= "\n";
6267

6368
if (!file_exists($destination)) {

docs/cmake/modules/FindACL.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindApache.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindAppArmor.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindArgon2.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindAtomic.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindBerkeleyDB.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindCapstone.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindCcache.md

Lines changed: 1 addition & 1 deletion

docs/cmake/modules/FindCdb.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)