Improve basename extraction in qt5_add_dbus_interfaces
This is a forward port of f46903b4b21e5d1c8af9a60e9ea87805b170ed73 in cmake.git. Change-Id: I627b17259182497c1353ccf4cd3fa4a61546be5d Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
6136bfffce
commit
897d0021dc
@ -73,9 +73,10 @@ endfunction()
|
|||||||
function(QT5_ADD_DBUS_INTERFACES _sources)
|
function(QT5_ADD_DBUS_INTERFACES _sources)
|
||||||
foreach(_current_FILE ${ARGN})
|
foreach(_current_FILE ${ARGN})
|
||||||
get_filename_component(_infile ${_current_FILE} ABSOLUTE)
|
get_filename_component(_infile ${_current_FILE} ABSOLUTE)
|
||||||
|
get_filename_component(_basename ${_current_FILE} NAME)
|
||||||
# get the part before the ".xml" suffix
|
# get the part before the ".xml" suffix
|
||||||
string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
|
|
||||||
string(TOLOWER ${_basename} _basename)
|
string(TOLOWER ${_basename} _basename)
|
||||||
|
string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
|
||||||
qt5_add_dbus_interface(${_sources} ${_infile} ${_basename}interface)
|
qt5_add_dbus_interface(${_sources} ${_infile} ${_basename}interface)
|
||||||
endforeach()
|
endforeach()
|
||||||
set(${_sources} ${${_sources}} PARENT_SCOPE)
|
set(${_sources} ${${_sources}} PARENT_SCOPE)
|
||||||
|
Loading…
Reference in New Issue
Block a user