Correctly detect qmake command.

qmake may be named qmake-qt5 on some distribution.
This commit is contained in:
Matthieu Gautier 2021-06-30 16:17:09 +02:00
parent 0e6ed1384c
commit c7ea2a31cb
2 changed files with 9 additions and 2 deletions

View File

@ -26,7 +26,10 @@ class PlatformNeutralEnv:
sys.exit("ERROR: ninja command not found.")
self.meson_command = self._detect_meson()
if not self.meson_command:
sys.exit("ERROR: meson command not found")
sys.exit("ERROR: meson command not found.")
self.qmake_command = self._detect_qmake()
if not self.qmake_command:
print("WARNING: qmake command not found.", file=sys.stderr)
self.mesontest_command = "{} test".format(self.meson_command)
def detect_platform(self):
@ -65,6 +68,9 @@ class PlatformNeutralEnv:
def _detect_meson(self):
return self._detect_binary('meson.py', 'meson')
def _detect_qmake(self):
return self._detect_binary('qmake-qt5', 'qmake')
class BuildEnv:
def __init__(self, platformInfo):

View File

@ -448,11 +448,12 @@ class QMakeBuilder(MakeBuilder):
def _configure(self, context):
context.try_skip(self.build_path)
cross_option = ""
command = ("qmake {configure_option}"
command = ("{command} {configure_option}"
" {env_option}"
" {source_path}"
" {cross_option}")
command = command.format(
command = neutralEnv('qmake_command'),
configure_option=self.configure_option,
env_option=self.env_option,
source_path=self.source_path,