]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/cmake.pm
Improve build system auto-selection process
[debhelper.git] / Debian / Debhelper / Buildsystem / cmake.pm
index 16796512dd06f44f11160e77079e901847d9ec46..3eddc74ff749db4182cc8dabdfdb5b06b99e06ba 100644 (file)
@@ -16,9 +16,12 @@ sub DESCRIPTION {
 sub check_auto_buildable {
        my $this=shift;
        my ($step)=@_;
-       my $ret = -e $this->get_sourcepath("CMakeLists.txt");
-       $ret &&= $this->SUPER::check_auto_buildable(@_) if $step ne "configure";
-       return $ret;
+       if (-e $this->get_sourcepath("CMakeLists.txt")) {
+               my $ret = $this->SUPER::check_auto_buildable(@_);
+               $ret++ if ($ret && -e $this->get_buildpath("CMakeCache.txt"));
+               return $ret > 0 ? $ret : 1;
+       }
+       return 0;
 }
 
 sub new {
@@ -34,11 +37,17 @@ sub configure {
 
        # Standard set of cmake flags
        push @flags, "-DCMAKE_INSTALL_PREFIX=/usr";
-       push @flags, "-DCMAKE_SKIP_RPATH=ON";
        push @flags, "-DCMAKE_VERBOSE_MAKEFILE=ON";
 
        $this->mkdir_builddir();
-       $this->doit_in_builddir("cmake", $this->get_source_rel2builddir(), @flags);
+       $this->doit_in_builddir("cmake", $this->get_source_rel2builddir(), @flags, @_);
+}
+
+sub test {
+       my $this=shift;
+
+       $ENV{CTEST_OUTPUT_ON_FAILURE} = 1;
+       return $this->test(@_);
 }
 
 1