diff options
author | Robert Griebl <robert.griebl@qt.io> | 2022-01-20 16:24:02 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-21 00:07:33 +0000 |
commit | bcdd87312d8f959a8b928d9e1bc5f614fea9e4b3 (patch) | |
tree | 833198dfafb7f19fc7cef92e76e506a7fa17ee79 | |
parent | f47861211d32ab76f7ce072bd0f6c1ca86efe9bd (diff) |
Change-Id: I8122e8a58585d6c25b9a8e6d7006a450e4278abf
Fixes: QTBUG-100088
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 17471110a10ac68d56e05df6dce318101ea00630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtAppManHelpers.cmake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cmake/QtAppManHelpers.cmake b/cmake/QtAppManHelpers.cmake index d19120a8..df1b9717 100644 --- a/cmake/QtAppManHelpers.cmake +++ b/cmake/QtAppManHelpers.cmake @@ -12,9 +12,23 @@ function(qtam_internal_add_dbus_adaptor target) DBUS_ADAPTOR_FLAGS ${arg_DBUS_ADAPTOR_FLAGS} ) - # hack to remove the .cpp file, which we implement ourselves + # The generated _adaptor.cpp files are not usable as is, so we implement + # that part ourselves. We have to make sure to not compile the generated + # ones though. + + # reconstruct the .cpp name (see QtDbusHelpers.cmake) + get_filename_component(file_name "${adaptor}" NAME_WLE) + get_filename_component(file_ext "${file_name}" LAST_EXT) + if("x${file_ext}" STREQUAL "x") + else() + string(SUBSTRING "${file_ext}" 1 -1 file_name) # cut of leading '.' + endif() + string(TOLOWER "${file_name}" file_name) + set(file_name "${file_name}_adaptor.cpp") + + # remove the .cpp file from SOURCES get_target_property(srcs ${target} SOURCES) - list(REMOVE_AT srcs -1) + list(REMOVE_ITEM srcs "${file_name}") set_target_properties(${target} PROPERTIES SOURCES "${srcs}") endforeach() |