diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-04-07 15:23:02 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-04-07 15:23:02 (GMT) |
commit | fcd09ca90ff052fbb560d8b1eff3e465066bb13b (patch) | |
tree | 2fe595ccf9ccb7d66048e439c7f362a6271f8cc8 /Modules/FindQt4.cmake | |
parent | c408760a8a8d2e8c65f231c399b4ed2e6d2087da (diff) | |
download | CMake-fcd09ca90ff052fbb560d8b1eff3e465066bb13b.zip CMake-fcd09ca90ff052fbb560d8b1eff3e465066bb13b.tar.gz CMake-fcd09ca90ff052fbb560d8b1eff3e465066bb13b.tar.bz2 |
BUG: Fix 6726. Create correct moc rule for configured headers in binary dir.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 4061664..e2f0971 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -992,7 +992,13 @@ 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(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) + STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) + IF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) + ELSE(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") + FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + ENDIF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}") SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") GET_FILENAME_COMPONENT(outpath ${_outfile} PATH) GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE) |