diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-01-29 18:07:52 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-01-29 18:07:52 (GMT) |
commit | bb52f45ebb6b1c80f8f7b8e2b841202118ed9d06 (patch) | |
tree | 141932a2c8e2bdd64469e784a09ad6265def2000 /Modules | |
parent | 3406e1ef2c13bef4e94ef7ce6f82a125ddde0c0e (diff) | |
download | CMake-bb52f45ebb6b1c80f8f7b8e2b841202118ed9d06.zip CMake-bb52f45ebb6b1c80f8f7b8e2b841202118ed9d06.tar.gz CMake-bb52f45ebb6b1c80f8f7b8e2b841202118ed9d06.tar.bz2 |
ENH: Allow QT4_WRAP_CPP to work with dir1/myobject.h dir2/myobject.h
Fixes #5067.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindQt4.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index bbfb69e..3cf3436 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -898,6 +898,16 @@ IF (QT4_QMAKE_FOUND) ENDIF ("${_currentArg}" STREQUAL "OPTIONS") ENDFOREACH(_currentArg) ENDMACRO (QT4_EXTRACT_OPTIONS) + + # 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}) + SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") + GET_FILENAME_COMPONENT(outpath ${_outfile} PATH) + GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE) + FILE(MAKE_DIRECTORY ${outpath}) + SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) + ENDMACRO (QT4_MAKE_OUTPUT_FILE ) MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS) SET(${_moc_INC_DIRS}) @@ -949,8 +959,7 @@ IF (QT4_QMAKE_FOUND) FOREACH (it ${moc_files}) GET_FILENAME_COMPONENT(it ${it} ABSOLUTE) - GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) - SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx) + QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile) QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_includes}" "${moc_options}") SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH(it) |