diff options
author | Robert Griebl <robert.griebl@qt.io> | 2022-01-20 16:24:02 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2022-01-20 15:33:00 +0000 |
commit | 17471110a10ac68d56e05df6dce318101ea00630 (patch) | |
tree | dd9ccfe912c205899a03dae8c5509cff4b28f6bf /cmake | |
parent | 7a38c13fc6038391089f0a2a3d474defbe1046bc (diff) | |
download | qtapplicationmanager-17471110a10ac68d56e05df6dce318101ea00630.tar.gz |
Use another way to not compile qdbusxml2cpp generated cpp files
Change-Id: I8122e8a58585d6c25b9a8e6d7006a450e4278abf
Fixes: QTBUG-100088
Pick-to: 6.2 6.2.3 6.3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-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() |