|
|
@@ -3,6 +3,9 @@
|
|
|
use strict;
|
|
|
use warnings;
|
|
|
|
|
|
+#my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
|
|
|
+my $cmake = "cmake";
|
|
|
+
|
|
|
my @variables;
|
|
|
my @commands;
|
|
|
my @properties;
|
|
|
@@ -10,7 +13,7 @@ my @modules;
|
|
|
my %keywords; # command => keyword-list
|
|
|
|
|
|
# unwanted upper-cases
|
|
|
-my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR);
|
|
|
+my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW);
|
|
|
# cannot remove ALL - exists for add_custom_command
|
|
|
|
|
|
# control-statements
|
|
|
@@ -24,9 +27,10 @@ my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_depen
|
|
|
push @modules, "ExternalProject";
|
|
|
|
|
|
# variables
|
|
|
-open(CMAKE, "cmake --help-variable-list|") or die "could not run cmake";
|
|
|
+open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake";
|
|
|
while (<CMAKE>) {
|
|
|
chomp;
|
|
|
+ next if /\</; # skip VARIABLES which contained <>-"templates"
|
|
|
push @variables, $_;
|
|
|
}
|
|
|
close(CMAKE);
|
|
|
@@ -35,17 +39,16 @@ close(CMAKE);
|
|
|
my %variables = map { $_ => 1 } @variables;
|
|
|
|
|
|
# commands
|
|
|
-open(CMAKE, "cmake --help-command-list|");
|
|
|
+open(CMAKE, "$cmake --help-command-list|");
|
|
|
while (my $cmd = <CMAKE>) {
|
|
|
chomp $cmd;
|
|
|
-
|
|
|
push @commands, $cmd;
|
|
|
}
|
|
|
close(CMAKE);
|
|
|
|
|
|
# now generate a keyword-list per command
|
|
|
foreach my $cmd (@commands) {
|
|
|
- my @word = extract_upper("cmake --help-command $cmd|");
|
|
|
+ my @word = extract_upper("$cmake --help-command $cmd|");
|
|
|
|
|
|
next if scalar @word == 0;
|
|
|
|
|
|
@@ -54,7 +57,7 @@ foreach my $cmd (@commands) {
|
|
|
|
|
|
# and now for modules
|
|
|
foreach my $mod (@modules) {
|
|
|
- my @word = extract_upper("cmake --help-module $mod|");
|
|
|
+ my @word = extract_upper("$cmake --help-module $mod|");
|
|
|
|
|
|
next if scalar @word == 0;
|
|
|
|
|
|
@@ -62,10 +65,10 @@ foreach my $mod (@modules) {
|
|
|
}
|
|
|
|
|
|
# and now for generator-expressions
|
|
|
-my @generator_expr = extract_upper("cmake --help-manual cmake-generator-expressions |");
|
|
|
+my @generator_expr = extract_upper("$cmake --help-manual cmake-generator-expressions |");
|
|
|
|
|
|
# properties
|
|
|
-open(CMAKE, "cmake --help-property-list|");
|
|
|
+open(CMAKE, "$cmake --help-property-list|");
|
|
|
while (<CMAKE>) {
|
|
|
chomp;
|
|
|
push @properties, $_;
|
|
|
@@ -88,7 +91,7 @@ while(<IN>)
|
|
|
! exists $deprecated{$_} } @commands;
|
|
|
print OUT " " x 12 , "\\ ", join(" ", @tmp), "\n";
|
|
|
} elsif ($1 eq "VARIABLE_LIST") {
|
|
|
- print OUT " " x 12 , "\\ ", join(" ", @variables), "\n";
|
|
|
+ print OUT " " x 12 , "\\ ", join(" ", sort keys %variables), "\n";
|
|
|
} elsif ($1 eq "MODULES") {
|
|
|
print OUT " " x 12 , "\\ ", join("\n", @modules), "\n";
|
|
|
} elsif ($1 eq "GENERATOR_EXPRESSIONS") {
|
|
|
@@ -101,9 +104,8 @@ while(<IN>)
|
|
|
print OUT " " x 12 , "\\ ", join(" ", sort keys %deprecated), "\n";
|
|
|
} elsif ($1 eq "KEYWORDS") {
|
|
|
foreach my $k (sort keys %keywords) {
|
|
|
- print OUT "syn keyword cmakeKW$k\n";
|
|
|
+ print OUT "syn keyword cmakeKW$k contained\n";
|
|
|
print OUT " " x 12, "\\ ", join(" ", @{$keywords{$k}}), "\n";
|
|
|
- print OUT " " x 12, "\\ contained\n";
|
|
|
print OUT "\n";
|
|
|
push @keyword_hi, "hi def link cmakeKW$k ModeMsg";
|
|
|
}
|
|
|
@@ -130,7 +132,8 @@ sub extract_upper
|
|
|
foreach my $w (m/\b([A-Z_]{2,})\b/g) {
|
|
|
next
|
|
|
if exists $variables{$w} or # skip if it is a variable
|
|
|
- exists $unwanted{$w}; # skip if not wanted
|
|
|
+ exists $unwanted{$w} or # skip if not wanted
|
|
|
+ grep(/$w/, @word); # skip if already in array
|
|
|
|
|
|
push @word, $w;
|
|
|
}
|