From 593c213f16fc47264519a1e73c682c5910c716d5 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Fri, 1 Feb 2008 13:52:04 -0500 Subject: BUG: When preserving relative paths for moc generated files, also consider paths to headers in the build directory. --- Modules/FindQt4.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 92f160b..a9d0815 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -903,7 +903,12 @@ 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 ) - FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + STRING(REGEX MATCH "${CMAKE_CURRENT_BINARY_DIR}" _match ${infile}) + IF(_match) + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) + ELSE(_match) + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + ENDIF(_match) SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") GET_FILENAME_COMPONENT(outpath ${_outfile} PATH) GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE) -- cgit v0.12