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';
20 sub check_auto_buildable {
22 my @projects=glob($this->get_sourcepath('*.pro'));
27 # Existence of a Makefile generated by qmake indicates qmake
28 # class has already been used by a prior build step, so should
29 # be used instead of the parent makefile class.
30 my $mf=$this->get_buildpath("Makefile");
32 $ret = $this->SUPER::check_auto_buildable(@_);
33 open(my $fh, '<', $mf)
34 or error("unable to open Makefile: $mf");
36 if (m/^# Generated by qmake/i) {
53 push @options, '-makefile';
54 push @options, '-nocache';
57 push @flags, "QMAKE_CFLAGS_RELEASE=$ENV{CFLAGS}";
58 push @flags, "QMAKE_CFLAGS_DEBUG=$ENV{CFLAGS}";
61 push @flags, "QMAKE_CXXFLAGS_RELEASE=$ENV{CXXFLAGS}";
62 push @flags, "QMAKE_CXXFLAGS_DEBUG=$ENV{CXXFLAGS}";
65 push @flags, "QMAKE_LFLAGS_RELEASE=$ENV{LDFLAGS}";
66 push @flags, "QMAKE_LFLAGS_DEBUG=$ENV{LDFLAGS}";
68 push @flags, "QMAKE_STRIP=:";
69 push @flags, "PREFIX=/usr";
71 $this->doit_in_builddir($qmake, @options, @flags, @_);
78 # qmake generated Makefiles use INSTALL_ROOT in install target
79 # where one would expect DESTDIR to be used.
80 $this->SUPER::install($destdir, "INSTALL_ROOT=$destdir", @_);