diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-01-29 11:06:35 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-01-30 12:55:59 +0100 |
commit | 5399f9443e30f7ca849b8096dbe9ee8c88a35c74 (patch) | |
tree | 08852aa59cd7b7346c33ca40c2cf90e098597df2 /src/corelib | |
parent | 9b0525729b161524c3ef5b1ec63c0c9ac3efb964 (diff) |
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/Qt5CoreMacros.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
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() |