Handle DESTDIR override

Set OUTPUT_DIRECTORY on a target when DESTDIR is specified.

Change-Id: I72061ae8156356fcb2aa9ba6cb87049fcef600c7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
This commit is contained in:
Leander Beernaert 2019-08-07 14:45:17 +02:00
parent f9db9a22e9
commit d8a7c0f40f

View File

@ -1800,6 +1800,11 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str,
cm_fh.write('{}list(APPEND test_data "{}")\n'.format(spaces(indent), data))
cm_fh.write('\n')
# Check for DESTDIR override
destdir = scope.get_string('DESTDIR')
if destdir:
extra_lines.append('OUTPUT_DIRECTORY "{}"'.format(destdir))
cm_fh.write('{}{}({}\n'.format(spaces(indent), cmake_function, name))
for extra_line in extra_lines:
cm_fh.write('{} {}\n'.format(spaces(indent), extra_line))