diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-13 19:22:08 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-11-13 19:22:08 (GMT) |
commit | ba238d785f77af38ee4b658b2849444a4758825d (patch) | |
tree | 056e7aa4485882e2d8201a9a5765b752891999ea /Modules/FindQt4.cmake | |
parent | 236692633b95474fef587d3c69de2923080bbdca (diff) | |
download | CMake-ba238d785f77af38ee4b658b2849444a4758825d.zip CMake-ba238d785f77af38ee4b658b2849444a4758825d.tar.gz CMake-ba238d785f77af38ee4b658b2849444a4758825d.tar.bz2 |
ENH: add depend information from qrc files
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 6c4728b..e13ddc7 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -776,11 +776,21 @@ IF (QT4_QMAKE_FOUND) FOREACH (it ${ARGN}) GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE) GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) + GET_FILENAME_COMPONENT(rc_path ${infile} PATH) SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx) + # parse file for dependencies + FILE(READ "${infile}" _RC_FILE_CONTENTS) + STRING(REGEX MATCHALL "<file>[^<]*" _RC_FILES "${_RC_FILE_CONTENTS}") + SET(_RC_DEPENDS) + FOREACH(_RC_FILE ${_RC_FILES}) + STRING(REGEX REPLACE "^<file>" "" _RC_FILE "${_RC_FILE}") + SET(_RC_DEPENDS ${_RC_DEPENDS} "${rc_path}/${_RC_FILE}") + ENDFOREACH(_RC_FILE) ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${QT_RCC_EXECUTABLE} ARGS -name ${outfilename} -o ${outfile} ${infile} - MAIN_DEPENDENCY ${infile} ) + MAIN_DEPENDENCY ${infile} + DEPENDS ${_RC_DEPENDS}) SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH (it) |