Qt5CoreMacros: Sync with CMake project counterpart

Port of CMake commits:

commit 2622bc3f65162bf6d6cb5838da6999f8b5ca75cf
Author: Rolf Eike Beer <eike@sf-mail.de>
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 <robert.maynard@kitware.com>
Date:   Thu Apr 3 11:27:58 2014 -0400

    Qt4Macros: Make QT4_CREATE_MOC_COMMAND a function

Change-Id: I5b928d114adb393ed9370163609311b7486e4a36
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
Kevin Funk 2015-12-21 17:56:55 +01:00 committed by Kevin Funk
parent b17e71dd08
commit feea236d92
1 changed files with 4 additions and 4 deletions

View File

@ -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 )