ENH: Allow QT4_WRAP_CPP to work with dir1/myobject.h dir2/myobject.h
Fixes #5067.
This commit is contained in:
parent
3406e1ef2c
commit
bb52f45ebb
|
@ -898,6 +898,16 @@ IF (QT4_QMAKE_FOUND)
|
||||||
ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
|
ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
|
||||||
ENDFOREACH(_currentArg)
|
ENDFOREACH(_currentArg)
|
||||||
ENDMACRO (QT4_EXTRACT_OPTIONS)
|
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)
|
MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
|
||||||
SET(${_moc_INC_DIRS})
|
SET(${_moc_INC_DIRS})
|
||||||
|
@ -949,8 +959,7 @@ IF (QT4_QMAKE_FOUND)
|
||||||
|
|
||||||
FOREACH (it ${moc_files})
|
FOREACH (it ${moc_files})
|
||||||
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
|
GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
|
||||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
|
||||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx)
|
|
||||||
QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_includes}" "${moc_options}")
|
QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_includes}" "${moc_options}")
|
||||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||||
ENDFOREACH(it)
|
ENDFOREACH(it)
|
||||||
|
|
Loading…
Reference in New Issue