From 17d9cd0b6a0b8dde8686f1fac5ca45b2c4ea23ae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Nov 2021 20:58:58 +0530 Subject: [PATCH] Add the SW prefix to cmake when building headless --- setup/build.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/build.py b/setup/build.py index e30654d2f1..7fdf07b6ef 100644 --- a/setup/build.py +++ b/setup/build.py @@ -458,7 +458,7 @@ class Build(Command): from setup.parallel_build import cpu_count if iswindows or ishaiku: return # Dont have headless operation on these platforms - from setup.build_environment import CMAKE + from setup.build_environment import CMAKE, sw self.info('\n####### Building headless QPA plugin', '#'*7) a = absolutize headers = a([ @@ -480,11 +480,14 @@ class Build(Command): bdir = self.j(self.build_dir, 'headless') if os.path.exists(bdir): shutil.rmtree(bdir) + cmd = [CMAKE] + if sw and os.path.exists(os.path.join(sw, 'qt')): + cmd += ['-DCMAKE_SYSTEM_PREFIX_PATH=' + os.path.join(sw, 'qt').replace(os.sep, '/')] os.makedirs(bdir) cwd = os.getcwd() os.chdir(bdir) try: - self.check_call([CMAKE, '-S', os.path.dirname(sources[0])]) + self.check_call(cmd + ['-S', os.path.dirname(sources[0])]) self.check_call([self.env.make] + ['-j%d'%(cpu_count or 1)]) finally: os.chdir(cwd)