1 # A debhelper build system class for Qt projects
2 # (based on the makefile class).
4 # Copyright: © 2010 Kelvin Modderman
7 package Debian::Debhelper::Buildsystem::qmake;
11 use Debian::Debhelper::Dh_Lib qw(error);
12 use base 'Debian::Debhelper::Buildsystem::makefile';
18 sub check_auto_buildable {
20 my @projects=glob($this->get_sourcepath('*.pro'));
25 # Existence of a Makefile generated by qmake indicates qmake
26 # class has already been used by a prior build step, so should
27 # be used instead of the parent makefile class.
28 my $mf=$this->get_buildpath("Makefile");
30 $ret = $this->SUPER::check_auto_buildable(@_);
31 open(my $fh, '<', $mf)
32 or error("unable to open Makefile: $mf");
34 if (m/^# Generated by qmake/i) {
51 push @options, '-makefile';
52 push @options, '-nocache';
55 push @flags, "QMAKE_CFLAGS_RELEASE=$ENV{CFLAGS}";
56 push @flags, "QMAKE_CFLAGS_DEBUG=$ENV{CFLAGS}";
59 push @flags, "QMAKE_CXXFLAGS_RELEASE=$ENV{CXXFLAGS}";
60 push @flags, "QMAKE_CXXFLAGS_DEBUG=$ENV{CXXFLAGS}";
63 push @flags, "QMAKE_LFLAGS_RELEASE=$ENV{LDFLAGS}";
64 push @flags, "QMAKE_LFLAGS_DEBUG=$ENV{LDFLAGS}";
66 push @flags, "QMAKE_STRIP=:";
67 push @flags, "PREFIX=/usr";
69 $this->doit_in_builddir('qmake', @options, @flags, @_);
76 # qmake generated Makefiles use INSTALL_ROOT in install target
77 # where one would expect DESTDIR to be used.
78 $this->SUPER::install($destdir, "INSTALL_ROOT=$destdir", @_);