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 <eike.ziller@qt.io>
This commit is contained in:
Eike Ziller
2020-10-27 12:53:07 +01:00
parent 3476b8aa67
commit 30017685e7

View File

@@ -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