Skip to content
This repository was archived by the owner on Jul 30, 2019. It is now read-only.

Commit b0ada6e

Browse files
committed
add <LANG>-replacing in variables.
1 parent 4e657a0 commit b0ada6e

File tree

2 files changed

+721
-6
lines changed

2 files changed

+721
-6
lines changed

Diff for: extract-upper-case.pl

+17-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
my @modules;
1414
my %keywords; # command => keyword-list
1515

16+
# find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort
17+
my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift);
18+
1619
# unwanted upper-cases
1720
my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW);
1821
# cannot remove ALL - exists for add_custom_command
@@ -30,8 +33,21 @@
3033
# variables
3134
open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake";
3235
while (<CMAKE>) {
33-
next if /\</; # skip if containing < or >
3436
chomp;
37+
38+
if (/<(.*?)>/) {
39+
if ($1 eq 'LANG') {
40+
foreach my $lang (@languages) {
41+
(my $V = $_) =~ s/<.*>/$lang/;
42+
push @variables, $V;
43+
}
44+
45+
next
46+
} else {
47+
next; # skip if containing < or >
48+
}
49+
}
50+
3551
push @variables, $_;
3652
}
3753
close(CMAKE);

0 commit comments

Comments
 (0)