summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Funk <kfunk@kde.org>2015-12-21 17:56:55 +0100
committerKevin Funk <kevin.funk@kdab.com>2015-12-21 22:42:19 +0000
commitfeea236d92656ef1a7cd2b94e3f3ca99c19f4e96 (patch)
treec2353ae8bf863699b3e3062f8487e0bd629c2c8e
parentb17e71dd082d12450217f12cb7a802949c9179e1 (diff)
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>
-rw-r--r--src/corelib/Qt5CoreMacros.cmake8
1 files changed, 4 insertions, 4 deletions
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 )