From 74aa6abac6b26f800619dea91fa8396e5efde2b2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:10:28 +0100 Subject: [PATCH] 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 --- cmake/QtBuild.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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()