diff options
author | Patrick Boettcher <p@yai.se> | 2019-05-29 14:58:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-29 15:57:17 (GMT) |
commit | b410dd5a05c83b7728a9c4501d5ca5bf7d11822c (patch) | |
tree | 6a77261d4609556ea43be7403c42ec8f5ba60096 /Auxiliary/vim/extract-upper-case.pl | |
parent | 067a4f484b1e2f650918d90051653b5c434c77a2 (diff) | |
parent | 06434fc2748f241eb6d89ffd2c0c66fb95dba9cb (diff) | |
download | CMake-b410dd5a05c83b7728a9c4501d5ca5bf7d11822c.zip CMake-b410dd5a05c83b7728a9c4501d5ca5bf7d11822c.tar.gz CMake-b410dd5a05c83b7728a9c4501d5ca5bf7d11822c.tar.bz2 |
Merge branch 'upstream-vim-cmake-syntax' into update-vim-syntax
* upstream-vim-cmake-syntax:
vim-cmake-syntax 2019-05-29 (c42ede9f)
Diffstat (limited to 'Auxiliary/vim/extract-upper-case.pl')
-rwxr-xr-x | Auxiliary/vim/extract-upper-case.pl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl index bd62ade..204b496 100755 --- a/Auxiliary/vim/extract-upper-case.pl +++ b/Auxiliary/vim/extract-upper-case.pl @@ -13,6 +13,9 @@ my @properties; my @modules; my %keywords; # command => keyword-list +# find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort +my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift); + # unwanted upper-cases my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW); # cannot remove ALL - exists for add_custom_command @@ -30,8 +33,21 @@ push @modules, "ExternalProject"; # variables open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake"; while (<CMAKE>) { - next if /\</; # skip if containing < or > chomp; + + if (/<(.*?)>/) { + if ($1 eq 'LANG') { + foreach my $lang (@languages) { + (my $V = $_) =~ s/<.*>/$lang/; + push @variables, $V; + } + + next + } else { + next; # skip if containing < or > + } + } + push @variables, $_; } close(CMAKE); |