Skip to content

Commit

Permalink
Fix headers generation for QtWebKit.
Browse files Browse the repository at this point in the history
syncqt assumes that the pro files of modules are named the same way as
the directory they are in. QtWebKit 2.2 has its main pro file called
QtWebKit.pro and not qt.pro even if it's located in src/3rdParty/webkit/Source/WebKit/qt.
This patch ensure that syncqt will look for a pro file if there is one in
the directory in the case there isn't one named the same way as the directory.

Reviewed-by:mariusSO
  • Loading branch information
Alexis Menard authored and Sergio Ahumada committed Jun 29, 2011
1 parent 85ba298 commit 223eab4
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions bin/syncqt
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,25 @@ foreach my $lib (@modules_to_sync) {
my $master_contents = "#ifndef QT_".$libcapitals."_MODULE_H\n#define QT_".$libcapitals."_MODULE_H\n";

#get dependencies
if(-e "$dir/" . basename($dir) . ".pro") {
if(open(F, "<$dir/" . basename($dir) . ".pro")) {
my $pro_file = "$dir/" . basename($dir) . ".pro";
if(!open(F, "<$pro_file")) {
#the pro file doesn't exist let's try to find one
opendir(DIR, $dir);
$pro_file = "";
foreach my $file (readdir(DIR))
{
if ( $file =~ /\.pro$/i) {
die "There are multiple pro files for $lib module, which one should I use? \n" if ($pro_file ne "");
$pro_file = "$dir/" . $file;
}
}
closedir(DIR);
if ($pro_file eq "") {
die "I couldn't find a pro file for $lib module \n";
}
}
if(-e "$pro_file") {
if(open(F, "<$pro_file")) {
while(my $line = <F>) {
chomp $line;
if($line =~ /^ *QT *\+?= *([^\r\n]*)/) {
Expand Down

0 comments on commit 223eab4

Please sign in to comment.