Fix inclusion of .qmake.cache for modules with config tests.

Qt modules with config tests generate a module level .qmake.cache with
the results of the config tests.  The existance of this file prevents
qmake from walking up the directory tree and finding the Qt global
cache file.  This results in the system build not working as expected.
For example running 'make' in the module would only build the contents
of src and skip tests and examples.

Fixed by adding a include statement to the end of the config test
generated .qmake.cache.

Change-Id: I68a5f2a96f4ee02076b6457ae085f45d894cd4ed
Reviewed-on: http://codereview.qt.nokia.com/3830
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Aaron McCarthy 2011-08-30 10:50:55 +10:00 committed by Qt by Nokia
parent 964793718f
commit 25a0cf881e

View File

@ -299,9 +299,10 @@ if (abs_path($out_basedir) ne abs_path($qtbasedir)) {
# Generate the new contents
my $newContents = $existingContents;
# Strip out any existing config test results
$newContents =~ s/^config_test_.*$//gms;
$newContents =~ s/^# Compile time test results.*$//gms;
# Strip out any existing config test results or include statements
$newContents =~ s/^config_test_[^\$]*$//gm;
$newContents =~ s/^# Compile time test results[^\$]*$//gm;
$newContents =~ s/include\(\$\$PWD\/..\/.qmake.cache\)$//gm;
# Add any remaining content and make sure we start on a new line
if ($newContents and chop $newContents ne '\n') {
@ -318,6 +319,12 @@ if (abs_path($out_basedir) ne abs_path($qtbasedir)) {
}
}
# Remove blank lines
$newContents =~ s/^[\s]*$//gms;
# Include top level .qmake.cache
$newContents = $newContents . "include(\$\$PWD/../.qmake.cache)\n";
# and open the file
open my $cacheFileHandle, ">$qmakeCachePath" or die "Unable to open $qmakeCachePath for writing: $!\n";