summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/QtAppManHelpers.cmake18
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()