BUG: Fix #7969. Fix moc output files if source dir contains regex characters.

This commit is contained in:
Clinton Stimpson 2008-11-05 17:56:55 -05:00
parent 19046aa98c
commit e8e4160cce
1 changed files with 7 additions and 5 deletions

View File

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