summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-01-29 11:06:35 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-01-29 12:51:12 +0100
commit8a3fde00bf53d99e9e4853e8ab97b0e1bcf74915 (patch)
treee71b44563ac437361d57ff36e0931bd5455aee16 /src
parent322ffe643cd21d8658c640a3de5d256328e5e970 (diff)
Fix qt5_make_output_file macro for paths containing dots
Commit 89bd5a7e broke CMake projects that use dots in their build paths, because the used regular expression matches the directory part of the path as well. The regex wants to achieve the same as 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-81715 Task-number: QTBUG-80295 Change-Id: I2ef053300948f6e1b2c0c5eafac35105f193d4e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt5CoreMacros.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 7735e51012..b3da6406a1 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)
- string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile})
+ 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()