From e8e4160cce0d50172d08d8a108dcf236c19703cd Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Wed, 5 Nov 2008 17:56:55 -0500 Subject: BUG: Fix #7969. Fix moc output files if source dir contains regex characters. --- Modules/FindQt4.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 3ed13a6..10b8a03 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -855,12 +855,14 @@ IF (QT4_QMAKE_FOUND) SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR}) IF(_infileLength GREATER _binlength) STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) - ENDIF(_infileLength GREATER _binlength) - IF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") - FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) - ELSE(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") + IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) + ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + ELSE(_infileLength GREATER _binlength) FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - ENDIF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") + ENDIF(_infileLength GREATER _binlength) SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") STRING(REPLACE ".." "__" _outfile ${_outfile}) GET_FILENAME_COMPONENT(outpath ${_outfile} PATH) -- cgit v0.12