diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-04-27 15:04:57 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-02 22:42:15 +0200 |
commit | 5a779a4ad350accadc4337d332eedb29ba1cc26b (patch) | |
tree | 50263a99b188539a28aaf733a07bb0072eab8fa8 /src/tools/qdbuscpp2xml | |
parent | 47c6466d0acc6d8d733b4fdbaf980a60bbfc93ef (diff) |
CMake: Make it possible to build tools when cross-compiling
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.
To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).
Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.
Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/tools/qdbuscpp2xml')
-rw-r--r-- | src/tools/qdbuscpp2xml/.prev_CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/tools/qdbuscpp2xml/CMakeLists.txt | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/qdbuscpp2xml/.prev_CMakeLists.txt b/src/tools/qdbuscpp2xml/.prev_CMakeLists.txt index 27e61681c2..fa02b5753c 100644 --- a/src/tools/qdbuscpp2xml/.prev_CMakeLists.txt +++ b/src/tools/qdbuscpp2xml/.prev_CMakeLists.txt @@ -4,7 +4,8 @@ ## qdbuscpp2xml Tool: ##################################################################### -qt_add_tool(qdbuscpp2xml +qt_get_tool_target_name(target_name qdbuscpp2xml) +qt_add_tool(${target_name} TARGET_DESCRIPTION "Qt D-Bus C++ to XML Compiler" SOURCES ../moc/cbordevice.h @@ -35,12 +36,12 @@ qt_add_tool(qdbuscpp2xml ## Scopes: ##################################################################### -qt_extend_target(qdbuscpp2xml CONDITION force_bootstrap +qt_extend_target(${target_name} CONDITION force_bootstrap PUBLIC_LIBRARIES bootstrap_dbusPrivate ) -qt_extend_target(qdbuscpp2xml CONDITION NOT force_bootstrap +qt_extend_target(${target_name} CONDITION NOT force_bootstrap PUBLIC_LIBRARIES Qt::DBusPrivate ) diff --git a/src/tools/qdbuscpp2xml/CMakeLists.txt b/src/tools/qdbuscpp2xml/CMakeLists.txt index de4f0f59bb..e831d5f392 100644 --- a/src/tools/qdbuscpp2xml/CMakeLists.txt +++ b/src/tools/qdbuscpp2xml/CMakeLists.txt @@ -4,7 +4,8 @@ ## qdbuscpp2xml Tool: ##################################################################### -qt_add_tool(qdbuscpp2xml +qt_get_tool_target_name(target_name qdbuscpp2xml) +qt_add_tool(${target_name} TARGET_DESCRIPTION "Qt D-Bus C++ to XML Compiler" TOOLS_TARGET DBus # special case SOURCES @@ -46,4 +47,3 @@ qt_add_tool(qdbuscpp2xml # extend_target(qdbuscpp2xml CONDITION force_bootstrap [...]) # extend_target(qdbuscpp2xml CONDITION NOT force_bootstrap [...]) # special case end - |