pro2cmake: Handle QMAKE_TARGET_XXX variables
Change-Id: I62151e04d21c20d8c8ad5825464f26074c8abc3d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
b82c5fa4ac
commit
286d79d2ed
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
qt_add_tool(moc
|
qt_add_tool(moc
|
||||||
BOOTSTRAP
|
BOOTSTRAP
|
||||||
|
TARGET_DESCRIPTION "Qt Meta Object Compiler"
|
||||||
SOURCES
|
SOURCES
|
||||||
cbordevice.h
|
cbordevice.h
|
||||||
collectjson.cpp collectjson.h
|
collectjson.cpp collectjson.h
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
qt_add_tool(moc
|
qt_add_tool(moc
|
||||||
BOOTSTRAP
|
BOOTSTRAP
|
||||||
|
TARGET_DESCRIPTION "Qt Meta Object Compiler"
|
||||||
TOOLS_TARGET Core # special case
|
TOOLS_TARGET Core # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
cbordevice.h
|
cbordevice.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qdbuscpp2xml
|
qt_add_tool(qdbuscpp2xml
|
||||||
|
TARGET_DESCRIPTION "Qt D-Bus C++ to XML Compiler"
|
||||||
SOURCES
|
SOURCES
|
||||||
../moc/cbordevice.h
|
../moc/cbordevice.h
|
||||||
../moc/collectjson.cpp ../moc/collectjson.h
|
../moc/collectjson.cpp ../moc/collectjson.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qdbuscpp2xml
|
qt_add_tool(qdbuscpp2xml
|
||||||
|
TARGET_DESCRIPTION "Qt D-Bus C++ to XML Compiler"
|
||||||
TOOLS_TARGET DBus # special case
|
TOOLS_TARGET DBus # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
../moc/cbordevice.h
|
../moc/cbordevice.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qdbusxml2cpp
|
qt_add_tool(qdbusxml2cpp
|
||||||
|
TARGET_DESCRIPTION "Qt D-Bus XML to C++ Compiler"
|
||||||
SOURCES
|
SOURCES
|
||||||
qdbusxml2cpp.cpp
|
qdbusxml2cpp.cpp
|
||||||
DEFINES
|
DEFINES
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qdbusxml2cpp
|
qt_add_tool(qdbusxml2cpp
|
||||||
|
TARGET_DESCRIPTION "Qt D-Bus XML to C++ Compiler"
|
||||||
TOOLS_TARGET DBus # special case
|
TOOLS_TARGET DBus # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
qdbusxml2cpp.cpp
|
qdbusxml2cpp.cpp
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qlalr
|
qt_add_tool(qlalr
|
||||||
|
TARGET_DESCRIPTION "Qt Look Ahead LR Parser Generator"
|
||||||
SOURCES
|
SOURCES
|
||||||
compress.cpp compress.h
|
compress.cpp compress.h
|
||||||
cppgenerator.cpp cppgenerator.h
|
cppgenerator.cpp cppgenerator.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qlalr
|
qt_add_tool(qlalr
|
||||||
|
TARGET_DESCRIPTION "Qt Look Ahead LR Parser Generator"
|
||||||
TOOLS_TARGET Core # special case
|
TOOLS_TARGET Core # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
compress.cpp compress.h
|
compress.cpp compress.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qvkgen
|
qt_add_tool(qvkgen
|
||||||
|
TARGET_DESCRIPTION "Qt Vulkan Header Generator"
|
||||||
SOURCES
|
SOURCES
|
||||||
qvkgen.cpp
|
qvkgen.cpp
|
||||||
PUBLIC_LIBRARIES
|
PUBLIC_LIBRARIES
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(qvkgen
|
qt_add_tool(qvkgen
|
||||||
|
TARGET_DESCRIPTION "Qt Vulkan Header Generator"
|
||||||
TOOLS_TARGET Gui # special case
|
TOOLS_TARGET Gui # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
qvkgen.cpp
|
qvkgen.cpp
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
qt_add_tool(rcc
|
qt_add_tool(rcc
|
||||||
BOOTSTRAP
|
BOOTSTRAP
|
||||||
|
TARGET_DESCRIPTION "Qt Resource Compiler"
|
||||||
SOURCES
|
SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
rcc.cpp rcc.h
|
rcc.cpp rcc.h
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
qt_add_tool(rcc
|
qt_add_tool(rcc
|
||||||
BOOTSTRAP
|
BOOTSTRAP
|
||||||
|
TARGET_DESCRIPTION "Qt Resource Compiler"
|
||||||
TOOLS_TARGET Core # special case
|
TOOLS_TARGET Core # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(uic
|
qt_add_tool(uic
|
||||||
|
TARGET_DESCRIPTION "Qt User Interface Compiler"
|
||||||
SOURCES
|
SOURCES
|
||||||
cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h
|
cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h
|
||||||
cpp/cppwriteincludes.cpp cpp/cppwriteincludes.h
|
cpp/cppwriteincludes.cpp cpp/cppwriteincludes.h
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
qt_add_tool(uic
|
qt_add_tool(uic
|
||||||
|
TARGET_DESCRIPTION "Qt User Interface Compiler"
|
||||||
TOOLS_TARGET Widgets # special case
|
TOOLS_TARGET Widgets # special case
|
||||||
SOURCES
|
SOURCES
|
||||||
cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h
|
cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h
|
||||||
|
@ -3049,6 +3049,19 @@ def write_generic_library(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> s
|
|||||||
|
|
||||||
return target_name
|
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:
|
def write_module(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
|
||||||
module_name = scope.TARGET
|
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
|
scope._is_public_module = is_public_module
|
||||||
|
|
||||||
target_name = module_name[2:]
|
target_name = module_name[2:]
|
||||||
|
forward_target_info(scope, extra)
|
||||||
write_main_part(
|
write_main_part(
|
||||||
cm_fh,
|
cm_fh,
|
||||||
target_name,
|
target_name,
|
||||||
@ -3124,6 +3138,8 @@ def write_tool(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
|
|||||||
else:
|
else:
|
||||||
extra = []
|
extra = []
|
||||||
|
|
||||||
|
forward_target_info(scope, extra)
|
||||||
|
|
||||||
write_main_part(
|
write_main_part(
|
||||||
cm_fh,
|
cm_fh,
|
||||||
tool_name,
|
tool_name,
|
||||||
@ -3178,7 +3194,6 @@ def write_test(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int =
|
|||||||
|
|
||||||
return test_name
|
return test_name
|
||||||
|
|
||||||
|
|
||||||
def write_binary(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int = 0) -> str:
|
def write_binary(cm_fh: IO[str], scope: Scope, gui: bool = False, *, indent: int = 0) -> str:
|
||||||
binary_name = scope.TARGET
|
binary_name = scope.TARGET
|
||||||
assert binary_name
|
assert binary_name
|
||||||
@ -3552,6 +3567,8 @@ def write_plugin(cm_fh, scope, *, indent: int = 0) -> str:
|
|||||||
if "static" in scope.get("CONFIG"):
|
if "static" in scope.get("CONFIG"):
|
||||||
extra.append("STATIC")
|
extra.append("STATIC")
|
||||||
|
|
||||||
|
forward_target_info(scope, extra)
|
||||||
|
|
||||||
write_main_part(
|
write_main_part(
|
||||||
cm_fh,
|
cm_fh,
|
||||||
plugin_name,
|
plugin_name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user