diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-22 21:01:32 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-05-19 13:26:53 +0200 |
commit | 759da6742a513fa3fb85bb6db569cff5a53a47d6 (patch) | |
tree | e3f45a31991eac56b6ac699a6ebb8678ff168780 /util/cmake/configurejson2cmake.py | |
parent | aed7a65b8b0870d8a019f7917888587de2a66303 (diff) |
CMake: Generate information about 3rdparty libs in module .pri files
For modules that are not yet ported to CMake and that use
QMAKE_USE += libfoo
we need to provide the information about libfoo in the qt_lib_XXX.pri
files.
Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs.
Task-number: QTBUG-75666
Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/configurejson2cmake.py')
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index f1bbcaca3e..7f7a103ef6 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -225,9 +225,29 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): # configure.cmake is interested in finding the system library # for the purpose of enabling or disabling a system_foo feature. find_package_kwargs["use_system_package_name"] = True + find_package_kwargs["module"] = ctx["module"] cm_fh.write(generate_find_package_info(newlib, **find_package_kwargs)) + if "use" in data["libraries"][lib]: + use_entry = data["libraries"][lib]["use"] + if isinstance(use_entry, str): + print(f"1use: {use_entry}") + cm_fh.write(f"qt_add_qmake_lib_dependency({newlib.soName} {use_entry})\n") + else: + for use in use_entry: + print(f"2use: {use}") + indentation = "" + has_condition = False + if "condition" in use: + has_condition = True + indentation = " " + condition = map_condition(use['condition']) + cm_fh.write(f"if({condition})\n") + cm_fh.write(f"{indentation}qt_add_qmake_lib_dependency({newlib.soName} {use['lib']})\n") + if has_condition: + cm_fh.write("endif()\n") + run_library_test = False mapped_library = find_3rd_party_library_mapping(lib) if mapped_library: |