summaryrefslogtreecommitdiffstats
path: root/util/cmake/pro2cmake.py
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-05-12 13:22:49 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-05-12 14:31:12 +0200
commit286d79d2ed6ed6627fad806954576a639ed0b95b (patch)
tree1e197b449a89410c11c25f6c92b38bf6d3b03b91 /util/cmake/pro2cmake.py
parentb82c5fa4ac4029e3e283f26537f3f7f0ef6f32c6 (diff)
pro2cmake: Handle QMAKE_TARGET_XXX variables
Change-Id: I62151e04d21c20d8c8ad5825464f26074c8abc3d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-xutil/cmake/pro2cmake.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 1764868715..cd43e2957e 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3049,6 +3049,19 @@ def write_generic_library(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> s
return target_name
+def forward_target_info(scope: Scope, extra: [str]):
+ s = scope.get_string("QMAKE_TARGET_PRODUCT")
+ if s:
+ extra.append(f"TARGET_PRODUCT \"{s}\"")
+ s = scope.get_string("QMAKE_TARGET_DESCRIPTION")
+ if s:
+ extra.append(f"TARGET_DESCRIPTION \"{s}\"")
+ s = scope.get_string("QMAKE_TARGET_COMPANY")
+ if s:
+ extra.append(f"TARGET_COMPANY \"{s}\"")
+ s = scope.get_string("QMAKE_TARGET_COPYRIGHT")
+ if s:
+ extra.append(f"TARGET_COPYRIGHT \"{s}\"")
def write_module(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
module_name = scope.TARGET
@@ -3092,6 +3105,7 @@ def write_module(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
scope._is_public_module = is_public_module
target_name = module_name[2:]
+ forward_target_info(scope, extra)
write_main_part(
cm_fh,
target_name,
@@ -3124,6 +3138,8 @@ def write_tool(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
else:
extra = []
+ forward_target_info(scope, extra)
+
write_main_part(
cm_fh,
tool_name,
@@ -3178,7 +3194,6 @@ def write_test(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int =
return test_name
-
def write_binary(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int = 0) -> str:
binary_name = scope.TARGET
assert binary_name
@@ -3552,6 +3567,8 @@ def write_plugin(cm_fh, scope, *, indent: int = 0) -> str:
if "static" in scope.get("CONFIG"):
extra.append("STATIC")
+ forward_target_info(scope, extra)
+
write_main_part(
cm_fh,
plugin_name,