summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-02-13 23:27:47 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-02-13 23:29:51 +0100
commitc53ee1f054fee2d6092c5e24b5b6b131dbd0457b (patch)
treeffdc87c81c72b545602c7380bbde3f0ab5c499e0 /util
parent60feaae1967aca5c7b1b0f6cb732962ddd1b2115 (diff)
parent0d177053b9406e2fb21802d23f2b2cdc0f974377 (diff)
Merge remote-tracking branch 'origin/wip/cmake' into dev
Conflicts: tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt Hopefully final merge from wip/cmake, and then all cmake changes should target dev directly. Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
Diffstat (limited to 'util')
-rw-r--r--util/cmake/helper.py1
-rwxr-xr-xutil/cmake/pro2cmake.py41
2 files changed, 41 insertions, 1 deletions
diff --git a/util/cmake/helper.py b/util/cmake/helper.py
index d427376088..142ca55c6b 100644
--- a/util/cmake/helper.py
+++ b/util/cmake/helper.py
@@ -297,6 +297,7 @@ _qt_library_map = [
LibraryMapping(
"service_support", "Qt6", "Qt::ServiceSupport", extra=["COMPONENTS", "ServiceSupport"]
),
+ LibraryMapping("shadertools", "Qt6", "Qt::ShaderTools", extra=["COMPONENTS", "ShaderTools"]),
LibraryMapping("sql", "Qt6", "Qt::Sql", extra=["COMPONENTS", "Sql"]),
LibraryMapping("svg", "Qt6", "Qt::Svg", extra=["COMPONENTS", "Svg"]),
LibraryMapping("testlib", "Qt6", "Qt::Test", extra=["COMPONENTS", "Test"]),
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index a93c506169..f5e678acd4 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -327,6 +327,7 @@ def set_up_cmake_api_calls():
api[2]["qt_add_resource"] = "qt_add_resource"
api[2]["qt_add_qml_module"] = "qt_add_qml_module"
api[2]["qt_add_cmake_library"] = "qt_add_cmake_library"
+ api[2]["qt_add_3rdparty_library"] = "qt_add_3rdparty_library"
return api
@@ -2802,6 +2803,41 @@ def write_main_part(
cm_fh.write(ignored_keys_report)
+def write_3rdparty_library(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
+
+ # Remove default QT libs.
+ scope._append_operation("QT", RemoveOperation(["core", "gui"]))
+
+ target_name = re.sub(r"^qt", "", scope.TARGET)
+ target_name = target_name.replace("-", "_")
+
+ library_type = ""
+
+ if "dll" in scope.get("CONFIG"):
+ library_type = "SHARED"
+ else:
+ library_type = "STATIC"
+
+ extra_lines = []
+
+ if library_type:
+ extra_lines.append(library_type)
+
+ write_main_part(
+ cm_fh,
+ target_name,
+ "Generic Library",
+ get_cmake_api_call("qt_add_3rdparty_library"),
+ scope,
+ extra_lines=extra_lines,
+ indent=indent,
+ known_libraries={},
+ extra_keys=[],
+ )
+
+ return target_name
+
+
def write_generic_library(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
target_name = scope.TARGET
@@ -3524,6 +3560,9 @@ def handle_app_or_lib(
if is_jar:
write_jar(cm_fh, scope, indent=indent)
+ elif "qt_helper_lib" in scope.get("_LOADED"):
+ assert not is_example
+ target = write_3rdparty_library(cm_fh, scope, indent=indent)
elif is_example:
target = write_example(cm_fh, scope, gui, indent=indent, is_plugin=is_plugin)
elif is_qt_plugin:
@@ -3593,7 +3632,7 @@ def handle_app_or_lib(
install_dir = scope.expandString("QMLTYPES_INSTALL_DIR")
if install_dir:
- install_dir = install_dir.replace("$$[QT_INSTALL_QML]", "${Qt6_DIR}/../../../qml")
+ install_dir = install_dir.replace("$$[QT_INSTALL_QML]", "${INSTALL_QMLDIR}")
cm_fh.write(f'{spaces(indent+1)}QT_QML_MODULE_INSTALL_DIR "{install_dir}"\n')
cm_fh.write(f"{spaces(indent)})\n\n")