From 30017685e7307c6246cc1ac6ef926da4352f6393 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 27 Oct 2020 12:53:07 +0100 Subject: [PATCH] build.py: add --add-module-path Which prepends a path to CMAKE_MODULE_PATH which is required for branding. Task-number: QTCREATORBUG-22488 Change-Id: I6b0015778d8ceec7183740e5b70eaafd220a3bdf Reviewed-by: Eike Ziller --- scripts/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build.py b/scripts/build.py index 2ffb35dda15..50247030fdf 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -93,6 +93,8 @@ def get_arguments(): action='store_true', default=False) parser.add_argument('--add-path', help='Prepends a CMAKE_PREFIX_PATH to the build', action='append', dest='prefix_paths', default=[]) + parser.add_argument('--add-module-path', help='Prepends a CMAKE_MODULE_PATH to the build', + action='append', dest='module_paths', default=[]) parser.add_argument('--add-make-arg', help='Passes the argument to the make tool.', action='append', dest='make_args', default=[]) parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. ' @@ -128,6 +130,10 @@ def build_qtcreator(args, paths): if args.python3: cmake_args += ['-DPYTHON_EXECUTABLE=' + args.python3] + if args.module_paths: + module_paths = [os.path.abspath(fp) for fp in args.module_paths] + cmake_args += ['-DCMAKE_MODULE_PATH=' + ';'.join(module_paths)] + # force MSVC on Windows, because it looks for GCC in the PATH first, # even if MSVC is first mentioned in the PATH... # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH