Replace get_filename_component usage with REGEX_REPLACE

Replace get_filename_component usage with custom string
REGEX_REPLACE to avoid cutting non-ending suffices while
moc generation

Fixes: QTBUG-80295
Change-Id: I8cdb729370c6d884f6638d172ee523fdc2df5404
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2019-11-25 11:59:48 +01:00
parent a5a37a7529
commit 89bd5a7e73

View File

@ -59,7 +59,7 @@ macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile )
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
string(REPLACE ".." "__" _outfile ${_outfile})
get_filename_component(outpath ${_outfile} PATH)
get_filename_component(_outfile ${_outfile} NAME_WE)
string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile})
file(MAKE_DIRECTORY ${outpath})
set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
endmacro()