From e13176e92b442a758d2ebf8d74bfd4fa02adc7cc Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Thu, 16 Jul 2009 18:53:20 -0400 Subject: [PATCH] BUG: fix relative paths from different drives on Windows --- Modules/FindQt4.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 1e22bb14f..f97aeccc3 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -965,6 +965,9 @@ IF (QT4_QMAKE_FOUND) ELSE(_infileLength GREATER _binlength) FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) ENDIF(_infileLength GREATER _binlength) + IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path + STRING(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}") + ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:") SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") STRING(REPLACE ".." "__" _outfile ${_outfile}) GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)