diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-03-18 19:16:40 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-03-20 10:45:14 +0000 |
commit | cb7a3aaa4cceff2b4502ce3d5c568e0b58f8e5fe (patch) | |
tree | ba9375e1d89a08dcbdc67b2f54a9bb66a6e84f1b | |
parent | 88549c28551538277a944d9ba690b19533a14e36 (diff) |
CMake: pro2cmake.py: Report more qmake variables as used
Report some more qmake variables as used when they are used to decide
which kind of target to write.
Change-Id: Id2602bb8cc07130456c04c53148acb73f21b0f21
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rwxr-xr-x | util/cmake/pro2cmake.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index a9d70ce84c..4c8d281549 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1237,7 +1237,8 @@ def write_simd_part(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cmake_function: str, scope: Scope, *, extra_lines: typing.List[str] = [], - indent: int = 0, **kwargs: typing.Any): + indent: int = 0, extra_keys: typing.List[str], + **kwargs: typing.Any): # Evaluate total condition of all scopes: recursive_evaluate_scope(scope) @@ -1252,6 +1253,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, assert scopes[0].total_condition == 'ON' scopes[0].reset_visited_keys() + for k in extra_keys: + scopes[0].get(k) # Now write out the scopes: write_header(cm_fh, name, typename, indent=indent) @@ -1302,7 +1305,7 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, extra_lines=extra, indent=indent, - known_libraries={'Qt::Core', }) + known_libraries={'Qt::Core', }, extra_keys=[]) if 'qt_tracepoints' in scope.get('CONFIG'): tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), @@ -1319,7 +1322,7 @@ def write_tool(cm_fh: typing.IO[str], scope: Scope, *, write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, indent=indent, known_libraries={'Qt::Core', }, - extra_lines=extra) + extra_lines=extra, extra_keys=['CONFIG']) def write_test(cm_fh: typing.IO[str], scope: Scope, *, @@ -1328,7 +1331,8 @@ def write_test(cm_fh: typing.IO[str], scope: Scope, *, assert test_name write_main_part(cm_fh, test_name, 'Test', 'add_qt_test', scope, - indent=indent, known_libraries={'Qt::Core', 'Qt::Test', }) + indent=indent, known_libraries={'Qt::Core', 'Qt::Test',}, + extra_keys=[]) def write_binary(cm_fh: typing.IO[str], scope: Scope, @@ -1347,7 +1351,7 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, extra_lines=extra, indent=indent, - known_libraries={'Qt::Core', }) + known_libraries={'Qt::Core', }, extra_keys=['target.path', 'INSTALLS']) def write_plugin(cm_fh, scope, *, indent: int = 0): @@ -1355,7 +1359,7 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): assert plugin_name write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, - indent=indent, known_libraries={'QtCore', }) + indent=indent, known_libraries={'QtCore', }, extra_keys=[]) def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, |