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

Commit

Permalink
add <LANG>-replacing in variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
pboettch committed Dec 20, 2018
1 parent 4e657a0 commit 02f7ee9
Show file tree
Hide file tree
Showing 2 changed files with 723 additions and 8 deletions.
22 changes: 19 additions & 3 deletions extract-upper-case.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
use warnings;
use POSIX qw(strftime);

#my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
my $cmake = "cmake";
my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
#my $cmake = "cmake";

my @variables;
my @commands;
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
Expand All @@ -30,8 +33,21 @@
# 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);
Expand Down
Loading

0 comments on commit 02f7ee9

Please sign in to comment.