diff options
author | Liang Qi <liang.qi@nokia.com> | 2012-01-13 10:57:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-28 14:44:48 +0100 |
commit | 273715fc9becb54996e28fda5ea5fb1624d571a2 (patch) | |
tree | a2e8480e01d936e5fceec7dd1e8fa463006a65f9 /bin | |
parent | dd7336571823ec626ba3d10a13bc49a73de53116 (diff) | |
download | qtbase-273715fc9becb54996e28fda5ea5fb1624d571a2.tar.gz |
Put the generated <module>version.h into build tree
It was put in source tree before.
Task-number: QTBUG-20439
Change-Id: Ib52d9c2e83ae375aad259ddc74138bbc728b3ed0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/bin/syncqt b/bin/syncqt index 1c9222c074..88f627dd3d 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -72,6 +72,9 @@ $qtbasedir =~ s=\\=/=g if (defined $qtbasedir); # will be defined based on the modules sync.profile our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %mastercontent, %modulepris, %explicitheaders, %deprecatedheaders); +# store the build path for %modules +my %modules_build = (); + # global variables (modified by options) my $isunix = 0; my $module = 0; @@ -831,6 +834,14 @@ my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate; $isunix = checkUnix; #cache checkUnix foreach my $lib (@modules_to_sync) { + my $modulebuildpath = "$out_basedir" . substr($modules{$lib}, length($basedir)); + unless(-e $modulebuildpath) { + make_path($modulebuildpath, $lib, $verbose_level); + } + $modules_build{$lib} = $modulebuildpath; +} + +foreach my $lib (@modules_to_sync) { #iteration info my $dir = $modules{$lib}; my $module_version = ""; @@ -933,8 +944,7 @@ foreach my $lib (@modules_to_sync) { my $modulepri = $modulepris{$lib}; if (-e $modulepri) { my $modulepriname = basename($modulepri); - # FIXME: this creates a file in the source location for shadow-builds - my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h"; + my $moduleversionheader = $modules_build{$lib} . "/" . lc($lib) . "version.h"; my $modulehexstring = sprintf("0x%02X%02X%02X", $module_major_version, $module_minor_version, $module_patch_version); open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader" or die "Can't open $moduleversionheader for writing"; print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n"; @@ -947,7 +957,6 @@ foreach my $lib (@modules_to_sync) { print MODULE_VERSION_HEADER_FILE "\n"; print MODULE_VERSION_HEADER_FILE "#endif // QT_". uc($lib) . "_VERSION_H\n"; close MODULE_VERSION_HEADER_FILE; - $moduleversionheader = "<srcbase>" . substr($moduleversionheader, length($basedir)) if ($verbose_level < 2); print "$lib: created version header $moduleversionheader\n" if($verbose_level); } elsif ($modulepri) { print "$lib: WARNING: Module\'s pri file '$modulepri' not found.\n$lib: Skipped creating module version header.\n"; @@ -966,6 +975,8 @@ foreach my $lib (@modules_to_sync) { foreach my $headers_dir (@headers_paths) { #calc subdirs my @subdirs = ($headers_dir); + #add the path for version header + push(@subdirs, $modules_build{$lib}) if ($modules_build{$lib}); foreach my $subdir (@subdirs) { opendir DIR, $subdir or next; foreach my $t (sort readdir(DIR)) { @@ -1089,7 +1100,10 @@ foreach my $lib (@modules_to_sync) { if ($verbose_level && $header_copies) { my $new_header_dirname = dirname($iheader); - $new_header_dirname = "<srcbase>" . substr($new_header_dirname, length($basedir)) if ($new_header_dirname && $verbose_level < 2); + if ($new_header_dirname && $verbose_level < 2) { + $new_header_dirname = "<srcbase>" . substr($new_header_dirname, length($basedir)) if ($new_header_dirname =~ /$basedir/); + $new_header_dirname = "<outbase>" . substr($new_header_dirname, length($out_basedir)) if ($new_header_dirname =~ /$out_basedir/); + } my $header_base = basename($iheader); if ($verbose_level < 3) { my $line_prefix = ","; @@ -1102,7 +1116,10 @@ foreach my $lib (@modules_to_sync) { } print "$line_prefix $header_base ($header_copies)"; } else { # $verbose_level >= 3 - $iheader = "<srcbase>" . substr($iheader, length($basedir)) if ($verbose_level == 3); + if ($verbose_level == 3) { + $iheader = "<srcbase>" . substr($iheader, length($basedir)) if ($iheader =~ /$basedir/); + $iheader = "<outbase>" . substr($iheader, length($out_basedir)) if ($iheader =~ /$out_basedir/); + } print "$lib: created $header_copies fwd-include headers for $iheader\n"; } } |