From 9b3a8547116047198d7a751bb630ab5741096aaf Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Tue, 8 May 2012 20:02:03 -0400 Subject: [PATCH] Fix check for qmake. qmake isn't always named 'qmake'. kdesrc-build searches for qmake before it runs to avoid having to take a long time to fail to build dozens of modules, but should search for the same names looked for by the FindQt4 cmake check. In addition to correcting the check, I've also fixed the usage of 'qmake' in the QMakeBuildSystem. Thanks for the prompt bug report! (And please re-open if this fails for you, it's a bit more difficult for me to thoroughly test) BUG:299577 FIXED-IN:1.15.1 --- kdesrc-build | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/kdesrc-build b/kdesrc-build index 28a4162..75ce053 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -3466,6 +3466,17 @@ EOF return qw{qmake}; } + # Returns the absolute path to 'qmake'. Note the actual executable name may + # not necessarily be 'qmake' as some distributions rename it to allow for + # co-installability with Qt 3 (and 5...) + # If no suitable qmake can be found, undef is returned. + # This is a "static class method" i.e. use QMakeBuildSystem::absPathToQMake() + sub absPathToQMake + { + my @possibilities = qw/qmake qmake4 qmake-qt4 qmake-mac/; + return grep { absPathToExecutable($_) } @possibilities; + } + # Return value style: boolean sub configureInternal { @@ -3485,7 +3496,10 @@ EOF } p_chdir($builddir); - return log_command($module, 'qmake', [ 'qmake', $projectFiles[0] ]) == 0; + + my $qmake = absPathToQMake(); + return 0 unless $qmake; + return log_command($module, 'qmake', [ $qmake, $projectFiles[0] ]) == 0; } 1; @@ -7771,7 +7785,14 @@ sub checkForEssentialBuildPrograms cmake => 'CMake', ); - if (!absPathToExecutable($prog)) { + my $programPath = absPathToExecutable($prog); + + # qmake is not necessarily named 'qmake' + if (!$programPath && $prog eq 'qmake') { + $programPath = QMakeBuildSystem::absPathToQMake(); + } + + if (!$programPath) { # Don't complain about Qt if we're building it... if ($prog eq 'qmake' && ( grep { $_->buildSystemType() eq 'Qt' } (@buildModules)) ||