From 7d85462cc346168931b8bed2154dde3e42f23671 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 7 Apr 2008 19:43:04 -0400 Subject: [PATCH] BUG: Fix problem with last patch when trying to take substr of shorter strings than expected. Fixes #6730. --- Modules/FindQt4.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e2f0971bc..3dfe1df67 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -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}")