summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-03-18 19:10:28 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-03-20 10:44:19 +0000
commit74aa6abac6b26f800619dea91fa8396e5efde2b2 (patch)
treeb2d5f40f55303428f0a4f0d2127f7e987e7da6b0
parentb173f0b905155b4e17160c5ea44f7625599f7fcb (diff)
CMake: Fix names for generated DBus adaptor/interface files
Use the same names for DBus adaptor/interface files that are also used by qmake. E.g. io.qt.something.xml will be turned into something_interface.(cpp|h) or something_adaptor.(cpp|h). Change-Id: I799b8aee7addd1fe590e8f3ec078e5325b68d5b1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtBuild.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index ffa0432edb..a14dc1e72d 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1043,7 +1043,22 @@ function(qt_create_qdbusxml2cpp_command target infile)
endif()
if ("${arg_BASENAME}" STREQUAL "")
- get_filename_component(file_name "${infile}" NAME_WE)
+ get_filename_component(file_dir "${infile}" DIRECTORY)
+ get_filename_component(file_name "${infile}" NAME_WLE)
+ get_filename_component(file_ext "${infile}" LAST_EXT)
+
+ if("${file_ext}" STREQUAL ".xml")
+ else()
+ message(FATAL_ERROR "DBUS ${type} input file is not xml.")
+ endif()
+
+ # use last part of io.qt.something.xml!
+ 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}_${type}")
else()