From feea236d92656ef1a7cd2b94e3f3ca99c19f4e96 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 21 Dec 2015 17:56:55 +0100 Subject: Qt5CoreMacros: Sync with CMake project counterpart Port of CMake commits: commit 2622bc3f65162bf6d6cb5838da6999f8b5ca75cf Author: Rolf Eike Beer Date: Sun Apr 6 21:30:00 2014 +0200 Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex) commit 7beba98652212c7a44f291b51dd03681e5193c49 Author: Robert Maynard Date: Thu Apr 3 11:27:58 2014 -0400 Qt4Macros: Make QT4_CREATE_MOC_COMMAND a function Change-Id: I5b928d114adb393ed9370163609311b7486e4a36 Reviewed-by: Oswald Buddenhagen --- src/corelib/Qt5CoreMacros.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/Qt5CoreMacros.cmake') diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 18563764ad..c0a8c62b04 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -53,8 +53,8 @@ macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile ) else() file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) endif() - if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path - string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}") + if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path + set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") endif() set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") string(REPLACE ".." "__" _outfile ${_outfile}) @@ -94,7 +94,7 @@ endmacro() # helper macro to set up a moc rule -macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) +function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) # Pass the parameters in a file. Set the working directory to # be that containing the parameters file and reference it by # just the file name. This is necessary because the moc tool on @@ -134,7 +134,7 @@ macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) DEPENDS ${infile} ${_moc_working_dir} VERBATIM) -endmacro() +endfunction() function(QT5_GENERATE_MOC infile outfile ) -- cgit v1.2.3