1 # A debhelper build system class for handling CMake based projects.
2 # It prefers out of source tree building.
4 # Copyright: © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::cmake;
10 use base 'Debian::Debhelper::Buildsystem::makefile';
13 "CMake (CMakeLists.txt)"
16 sub check_auto_buildable {
19 if (-e $this->get_sourcepath("CMakeLists.txt")) {
20 my $ret = ($step eq "configure" && 1) ||
21 $this->SUPER::check_auto_buildable(@_);
22 # Existence of CMakeCache.txt indicates cmake has already
23 # been used by a prior build step, so should be used
24 # instead of the parent makefile class.
25 $ret++ if ($ret && -e $this->get_buildpath("CMakeCache.txt"));
33 my $this=$class->SUPER::new(@_);
34 $this->prefer_out_of_source_building(@_);
42 # Standard set of cmake flags
43 push @flags, "-DCMAKE_INSTALL_PREFIX=/usr";
44 push @flags, "-DCMAKE_VERBOSE_MAKEFILE=ON";
46 $this->mkdir_builddir();
47 $this->doit_in_builddir("cmake", $this->get_source_rel2builddir(), @flags, @_);
53 $ENV{CTEST_OUTPUT_ON_FAILURE} = 1;
54 return $this->test(@_);