diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-09-18 15:57:31 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-10-21 10:19:22 +0000 |
commit | 3183f33d3024539bf3ff2e4c32784a3a0b9826f7 (patch) | |
tree | 0dfb6aec16f8af3bbe2904f16eabad7cdc94ed72 /packaging-tools/bld_module.py | |
parent | 2b069a9e57b53140b171da1acfbfed81c17c6d03 (diff) |
bld_module: Simplify getting QT_INSTALL_PREFIX
- There is no need for a complicated search for qmake
- With "qmake -query <VAR>" it is possible to get just the value for the
wanted variable
Change-Id: I72387406e5c05aa7343dab37fda3639adcac8ade
Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
Diffstat (limited to 'packaging-tools/bld_module.py')
-rwxr-xr-x | packaging-tools/bld_module.py | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/packaging-tools/bld_module.py b/packaging-tools/bld_module.py index 7dac09e11..7b0856601 100755 --- a/packaging-tools/bld_module.py +++ b/packaging-tools/bld_module.py @@ -73,26 +73,9 @@ def patch_archive(base_dir, search_string, qt_install_prefix): # function ############################### def get_qt_install_prefix(qt_path): - qmake_executable = 'qmake' - qt_install_prefix = '' - if bldinstallercommon.is_win_platform(): - qmake_executable += '.exe' - qmake_executable = bldinstallercommon.locate_file(qt_path, qmake_executable) - if not os.path.isfile(qmake_executable): - print('*** Unable to locate qmake executable from: {0}'.format(qt_path)) - sys.exit(-1) - cmd_args = [qmake_executable, '-query'] - qmakePath = os.path.abspath(os.path.join(callerArguments.qt5path, 'bin')) - dummy, output = bldinstallercommon.do_execute_sub_process(cmd_args, qmakePath, get_output=True) - # read output line by line - lines = output.splitlines(True) - for line in lines: - if 'QT_INSTALL_PREFIX' in line: - # save qt_install_prefix - qt_install_prefix = line[line.index(':') + 1:] - break - - return qt_install_prefix + cmd_args = [os.path.join(qt_path, 'bin', 'qmake'), '-query', 'QT_INSTALL_PREFIX'] + ret, qt_install_prefix = bldinstallercommon.do_execute_sub_process(cmd_args, qt_path, get_output=True) + return qt_install_prefix.strip() ############################### # function @@ -126,7 +109,7 @@ def patch_build_time_paths(search_path, search_string, qt_install_prefix): if not search_string in line: print(line.rstrip('\n')) continue - patched_line = line.replace(search_string, qt_install_prefix.rstrip('\n')) + patched_line = line.replace(search_string, qt_install_prefix) print(patched_line.rstrip('\n')) ############################### |