BUG: Fix problem with last patch when trying to take substr of shorter strings

than expected.  Fixes #6730.
This commit is contained in:
Clinton Stimpson 2008-04-07 19:43:04 -04:00
parent 7d2bbfe842
commit 7d85462cc3
1 changed files with 5 additions and 1 deletions

View File

@ -993,7 +993,11 @@ IF (QT4_QMAKE_FOUND)
# macro used to create the names of output files preserving relative dirs
MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
STRING(LENGTH ${infile} _infileLength)
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}")