ITK/Release 4/Wrapping/Tasks/WrapITKModular

From KitwarePublic
Jump to navigationJump to search

Modular WrapITK

Mapping of files

Script used to obtain the mapping

#!/usr/bin/perl -w 
require 5.004;
 
$fname = "Ashish_AllWrapFiles";
$outname = "Ashish_ModFiles";

# First, prepare the input file
open(FILE2, ">$fname") || die "Could not open $fname\n";
system("find . -name \*\.wrap >> $fname")  == 0 || die "system error $?"; 
close(FILE2);
# Next, process and write it in the output file
open(FILE, "$fname") || die "Could not open $fname\n";
open (OUTPUT, ">$outname") || die "Could not open $outname\n";
#$pattern = '^\.\/Wrapping\/WrapITK\/Libraries\/(\w*)\/(\w*)\.wrap';
$pattern = '^\.\/(((\w*)\/)+)(\w*)\.wrap';

while ($line = <FILE>) { 
    chomp($line);
    if($line=~/$pattern/)  {
        system("find . -name \'$4.h\' >> $outname") == 0 || die "system error $?"; 
    }
} 
close(FILE);
close(OUTPUT);