diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-09-22 19:00:31 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-09-22 19:00:31 (GMT) |
commit | 33e87980cbe68dba76f53cde07889e5dbdd385f7 (patch) | |
tree | 09c8695d7396c0d9d25dda1655f81716655d8ae1 /Modules/FindQt4.cmake | |
parent | 67dc176ffaa8c813d6156f14ff07c4685769aef8 (diff) | |
download | CMake-33e87980cbe68dba76f53cde07889e5dbdd385f7.zip CMake-33e87980cbe68dba76f53cde07889e5dbdd385f7.tar.gz CMake-33e87980cbe68dba76f53cde07889e5dbdd385f7.tar.bz2 |
ENH: Fix #7433. Put list of files in a .pro file and call lupdate on it,
instead of putting the list of files on the command line.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index c6ee799..566a7a0 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1295,21 +1295,35 @@ IF (QT4_QMAKE_FOUND) MACRO(QT4_CREATE_TRANSLATION _qm_files) QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN}) SET(_my_sources) + SET(_my_dirs) SET(_my_tsfiles) + SET(_ts_pro) FOREACH (_file ${_lupdate_files}) GET_FILENAME_COMPONENT(_ext ${_file} EXT) GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE) IF(_ext MATCHES "ts") LIST(APPEND _my_tsfiles ${_abs_FILE}) ELSE(_ext MATCHES "ts") - LIST(APPEND _my_sources ${_abs_FILE}) + IF(NOT _ext) + LIST(APPEND _my_dirs ${_abs_FILE}) + ELSE(NOT _ext) + LIST(APPEND _my_sources ${_abs_FILE}) + ENDIF(NOT _ext) ENDIF(_ext MATCHES "ts") ENDFOREACH(_file) FOREACH(_ts_file ${_my_tsfiles}) + IF(_my_sources) + # make a .pro file to call lupdate on, so we don't make our commands too + # long for some systems + GET_FILENAME_COMPONENT(_ts_name ${_ts_file} NAME_WE) + SET(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro) + STRING(REPLACE ";" " " _pro_srcs "${_my_sources}") + FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}") + ENDIF(_my_sources) ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file} COMMAND ${QT_LUPDATE_EXECUTABLE} - ARGS ${_lupdate_options} ${_my_sources} -ts ${_ts_file} - DEPENDS ${_my_sources}) + ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file} + DEPENDS ${_my_sources} ${_ts_pro}) ENDFOREACH(_ts_file) QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles}) ENDMACRO(QT4_CREATE_TRANSLATION) |