only build cmake if needed

svn path=/trunk/KDE/kdesdk/scripts/kdesvn-build-coverity; revision=574251
wilder
Dirk Mueller 20 years ago
parent 80195399c7
commit 758bf30d26
  1. 28
      kdesvn-build-coverity

@ -111,6 +111,20 @@ sub download_install_dbus()
return 1;
}
# This subroutine checks if an appropriate dbus software is already installed.
# Currently this means DBUS 0.62.
#
# Return value is true if DBUS is installed, 0 otherwise.
sub check_cmake_installed()
{
my $minVersion = '2.4-patch 3';
my $result = system('cmake', '--version');
return ($result >> 8) == 0 && ($result =~ $minVersion);
}
# This subroutine downloads CMake if necessary, builds and installs it (all
# in one step: there is no separate update then install).
#
@ -190,6 +204,8 @@ sub download_install_cmake()
return 1;
}
# This subroutine is run after the lock has been obtained, but before performing
# any updates or builds. Do any steps that need to be done only in the case of
# being run by Coverity. This subroutine is only called if the COVERITY_RUN
@ -217,7 +233,17 @@ sub perform_coverity_checks()
system("pkg-config", "--variable=prefix", "dbus-1");
}
download_install_cmake();
unless (check_cmake_installed())
{
info "CMake 2.4.3 does not appear to be installed. At least its not in \$PATH";
info "So just for you guys, I'll go ahead and install it for you.";
if (not download_install_cmake())
{
error "\nWell, we were b[r[unable to install] CMake for some reason.";
error "Check your logs afterwards.";
}
}
# Print blank line.
info "";

Loading…
Cancel
Save