From 5399f9443e30f7ca849b8096dbe9ee8c88a35c74 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 29 Jan 2020 11:06:35 +0100 Subject: Fix qt5_make_output_file macro for file base names with dots The qt5_make_output_file macro returns the wrong outfile for infiles containing multiple dots in the file name, e.g. 'foo.bar.h'. To fix this we need to use get_filename_component(... NAME_WLE) which is available since CMake 3.14. Re-implement the NAME_WLE functionality for older CMake versions by using multiple get_filename_component calls. Fixes: QTBUG-80295 Change-Id: Ib8e11a69a41ba7f6739eb3d5541ce8f6f59dc18c Reviewed-by: Alexandru Croitor --- src/corelib/Qt5CoreMacros.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 84c75401b1..02f49a4b1e 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -59,7 +59,14 @@ 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) + if(CMAKE_VERSION VERSION_LESS "3.14") + get_filename_component(_outfile_ext ${_outfile} EXT) + get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE) + get_filename_component(_outfile ${_outfile} NAME_WE) + string(APPEND _outfile ${_outfile_ext}) + else() + get_filename_component(_outfile ${_outfile} NAME_WLE) + endif() file(MAKE_DIRECTORY ${outpath}) set(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) endmacro() -- cgit v1.2.3