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>
This commit is contained in:
parent
88549c2855
commit
cb7a3aaa4c
@ -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,
|
def write_main_part(cm_fh: typing.IO[str], name: str, typename: str,
|
||||||
cmake_function: str, scope: Scope, *,
|
cmake_function: str, scope: Scope, *,
|
||||||
extra_lines: typing.List[str] = [],
|
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:
|
# Evaluate total condition of all scopes:
|
||||||
recursive_evaluate_scope(scope)
|
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'
|
assert scopes[0].total_condition == 'ON'
|
||||||
|
|
||||||
scopes[0].reset_visited_keys()
|
scopes[0].reset_visited_keys()
|
||||||
|
for k in extra_keys:
|
||||||
|
scopes[0].get(k)
|
||||||
|
|
||||||
# Now write out the scopes:
|
# Now write out the scopes:
|
||||||
write_header(cm_fh, name, typename, indent=indent)
|
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,
|
write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope,
|
||||||
extra_lines=extra, indent=indent,
|
extra_lines=extra, indent=indent,
|
||||||
known_libraries={'Qt::Core', })
|
known_libraries={'Qt::Core', }, extra_keys=[])
|
||||||
|
|
||||||
if 'qt_tracepoints' in scope.get('CONFIG'):
|
if 'qt_tracepoints' in scope.get('CONFIG'):
|
||||||
tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'),
|
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,
|
write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope,
|
||||||
indent=indent, known_libraries={'Qt::Core', },
|
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, *,
|
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
|
assert test_name
|
||||||
|
|
||||||
write_main_part(cm_fh, test_name, 'Test', 'add_qt_test', scope,
|
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,
|
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,
|
write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope,
|
||||||
extra_lines=extra, indent=indent,
|
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):
|
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
|
assert plugin_name
|
||||||
|
|
||||||
write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope,
|
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], *,
|
def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user