From 25a0cf881e6ca6dc8bd969e7047c3967796fcd94 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 30 Aug 2011 10:50:55 +1000 Subject: 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 Reviewed-by: Michael Goddard --- bin/qtmodule-configtests | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin/qtmodule-configtests') diff --git a/bin/qtmodule-configtests b/bin/qtmodule-configtests index ab03908c84..4b4c5ae96c 100755 --- a/bin/qtmodule-configtests +++ b/bin/qtmodule-configtests @@ -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"; -- cgit v1.2.3