]> 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 03e6ade591017f02df80807df0f2f9737b92d076..3eddc74ff749db4182cc8dabdfdb5b06b99e06ba 100644 (file)
@@ -16,12 +16,12 @@ sub DESCRIPTION {
 sub check_auto_buildable {
        my $this=shift;
        my ($step)=@_;
-       my $ret = -e $this->get_sourcepath("CMakeLists.txt");
-       if ($step ne "configure") {
-               $ret &&= -e $this->get_buildpath("CMakeCache.txt") &&
-                        $this->SUPER::check_auto_buildable(@_);
+       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 $ret;
+       return 0;
 }
 
 sub new {