File indexing completed on 2024-12-01 05:11:27

0001 #!/usr/bin/perl
0002 
0003 # laurent Montel <montel@kde.org> 2007 GPL
0004 # This script will remove not necessary cmake variable (already defined by dependancy)
0005 #
0006 
0007 use File::Basename;
0008 use lib dirname( $0 );
0009 use functionUtilkde;
0010 use strict;
0011 
0012 open(my $F, "-|", qw(find . -name CMakeLists.txt));
0013 my $file;
0014 my $warning;
0015 while ($file = <$F>) {
0016     chomp $file;
0017     next if functionUtilkde::excludeFile( $file);
0018     my $modified;
0019     open(my $FILE, $file) or warn "We can't open file $file:$!\n";
0020     my @l = map {
0021     my $orig = $_;
0022 
0023     if( /KDE4_KWALLETCLIENT_LIBS/ )
0024     {
0025         s!\${/KDE4_KWALLETCLIENT_LIBS} !!;
0026     }
0027     if( /KDE4_KSPELL2_LIBS/ )
0028     {
0029         s!\${KDE4_KSPELL2_LIBS} !!;
0030     }
0031         if( /KDE4_KDEPRINT_LIBS/ )
0032         {
0033                 s!\${KDE4_KDEPRINT_LIBS} !!;
0034         }
0035         if ( /target_link_libraries/ or /TARGET_LINK_LIBRARIES/) {
0036                 if( $_ =~ m/\${KDE4_KDECORE_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0037                 {
0038                         s!\${KDE4_KDECORE_LIBS} !!;
0039                 }
0040         if( $_ =~ m/\${KDE4_KIO_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0041         {
0042             s!\${KDE4_KDEUI_LIBS} !!;
0043         }
0044         # dependancy for kfile
0045                 if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0046                 {
0047                         s!\${KDE4_KDEUI_LIBS} !!;
0048                 }
0049                 if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0050                 {
0051                         s!\${KDE4_KDECORE_LIBS} !!;
0052                 }                
0053         if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0054                 {
0055                         s!\${KDE4_KIO_LIBS} !!;
0056                 }
0057                 if( $_ =~ m/\${KDE4_KFILE_LIBS}/ and $_ =~ m/\${KDE4_SOLID_LIBS}/ )
0058                 {
0059                         s!\${KDE4_SOLID_LIBS} !!;
0060                 }
0061         # dependancy for kdesu
0062                 if( $_ =~ m/\${KDE4_KDESU_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0063                 {
0064                         s!\${KDE4_KDESU_LIBS} !!;
0065                 }
0066         # dependancy for kparts
0067         if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0068                 {
0069                         s!\${KDE4_KDECORE_LIBS} !!;
0070                 }
0071                 if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0072                 {
0073                         s!\${KDE4_KDEUI_LIBS} !!;
0074                 }
0075                 if( $_ =~ m/\${KDE4_KPARTS_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0076                 {
0077                         s!\${KDE4_KIO_LIBS} !!;
0078                 }
0079         #dependancy for knewstuff2
0080                 if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0081                 {
0082                         s!\${KDE4_KIO_LIBS} !!;
0083                 }
0084                 if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0085                 {
0086                         s!\${KDE4_KDECORE_LIBS} !!;
0087                 }
0088                 if( $_ =~ m/\${KDE4_KNEWSTUFF2_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0089                 {
0090                         s!\${KDE4_KDEUI_LIBS} !!;
0091                 }
0092         #dependancy for kutils
0093                 if( $_ =~ m/\${KDE4_KUTILS_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0094                 {
0095                         s!\${KDE4_KDECORE_LIBS} !!;
0096                 }
0097 
0098                 if( $_ =~ m/\${KDE4_KUTILS_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0099                 {
0100                         s!\${KDE4_KDEUI_LIBS} !!;
0101                 }
0102         #dependancy for khtml
0103         if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0104         {
0105             s!\${KDE4_KDECORE_LIBS} !!;
0106         }
0107                 if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0108                 {
0109                         s!\${KDE4_KIO_LIBS} !!;
0110                 }
0111                 if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0112                 {
0113                         s!\${KDE4_KDEUI_LIBS} !!;
0114                 }
0115                 if( $_ =~ m/\${KDE4_KHTML_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
0116                 {
0117                         s!\${KDE4_KPARTS_LIBS} !!;
0118                 }
0119         #dependancy for ktexteditor
0120                 if( $_ =~ m/\${KDE4_KTEXTEDITOR_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0121                 {
0122                         s!\${KDE4_KDECORE_LIBS} !!;
0123                 }
0124                 if( $_ =~ m/\${KDE4_KTEXTEDITOR_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
0125                 {
0126                         s!\${KDE4_KPARTS_LIBS} !!;
0127                 }
0128         #dependancy for KDE4_KPIMIDENTITIES_LIBS
0129         if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0130                 {
0131                         s!\${KDE4_KDECORE_LIBS} !!;
0132                 }
0133                 if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0134                 {
0135                         s!\${KDE4_KDEUI_LIBS} !!;
0136                 }
0137                 if( $_ =~ m/\${KDE4_KPIMIDENTITIES_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0138                 {
0139                         s!\${KDE4_KIO_LIBS} !!;
0140                 }
0141         #dependancy for KDE4_KDNSSD_LIBS
0142         if( $_  =~ m/\${KDE4_KDNSSD_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0143                 {
0144                         s!\${KDE4_KDECORE_LIBS} !!;
0145                 }
0146                 if( $_  =~ m/\${KDE4_KDNSSD_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0147                 {
0148                         s!\${KDE4_KDEUI_LIBS} !!;
0149                 }
0150 
0151         # Not remove them it will necessary when we removed kde3support into apps.
0152         #if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0153         #{
0154         #   s!\${KDE4_KDECORE_LIBS} !!;
0155         #}
0156         #if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDECORE_LIBS}/ )
0157         #{
0158         #        s!\${KDE4_KDECORE_LIBS} !!;
0159         #}
0160         #if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KDEUI_LIBS}/ )
0161         #{
0162         #        s!\${KDE4_KDEUI_LIBS} !!;
0163         #}
0164         #if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KIO_LIBS}/ )
0165         #{
0166         #        s!\${KDE4_KIO_LIBS} !!;
0167         #}
0168         #if( $_ =~ m/\${KDE4_KDE3SUPPORT_LIBS}/ and $_ =~ m/\${KDE4_KPARTS_LIBS}/ )
0169         #{
0170         #        s!\${KDE4_KPARTS_LIBS} !!;
0171         #}
0172     }
0173     $modified ||= $orig ne $_;
0174     $_;
0175     } <$FILE>;
0176 
0177     if ($modified) {
0178     open (my $OUT, ">", $file);
0179     print $OUT @l;
0180     }
0181 
0182 }
0183 functionUtilkde::diffFile( <$F> );