BUG: When preserving relative paths for moc generated files,

also consider paths to headers in the build directory.
This commit is contained in:
Clinton Stimpson 2008-02-01 13:52:04 -05:00
parent 16186ec18c
commit 593c213f16
1 changed files with 6 additions and 1 deletions

View File

@ -903,7 +903,12 @@ IF (QT4_QMAKE_FOUND)
# macro used to create the names of output files preserving relative dirs # macro used to create the names of output files preserving relative dirs
MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile ) 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}") SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
GET_FILENAME_COMPONENT(outpath ${_outfile} PATH) GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE) GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)