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-20 20:10:22 +0000 |
commit | 6a2a860e3205ed71f43027d116d199eed066c479 (patch) | |
tree | 6b5ffb0a88bf41bf043d4958b8c9d300bef6fbf0 | |
parent | c71a3d5d8e75bf9c60af912605dfa1231b78a5a3 (diff) | |
download | qtapplicationmanager-6a2a860e3205ed71f43027d116d199eed066c479.tar.gz |
Use another way to not compile qdbusxml2cpp generated cpp files
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() |