mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
ship the translations within the binary
build qm-files for translation create resource file for translations, contains german translations, for now. this is some kind of hack to make it work. rcc doesn’t allow out-of-source builds, so the commands need to be specified by hand, to copy things around between source and binary directories.
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
f5ba469b0a
commit
a55124ed75
5
lang/tomahawk_i18n.qrc
Normal file
5
lang/tomahawk_i18n.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/lang">
|
||||
<file>tomahawk_de.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
25
lang/translations.cmake
Normal file
25
lang/translations.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
FILE (GLOB TS_FILES ${CMAKE_SOURCE_DIR}/lang/*.ts)
|
||||
QT4_ADD_TRANSLATION(QM_FILES ${TS_FILES})
|
||||
|
||||
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
|
||||
SET( trans_file tomahawk_i18n )
|
||||
SET( trans_srcfile ${CMAKE_SOURCE_DIR}/lang/${trans_file}.qrc)
|
||||
SET( trans_infile ${CMAKE_CURRENT_BINARY_DIR}/${trans_file}.qrc)
|
||||
SET( trans_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${trans_file}.cxx)
|
||||
|
||||
# Copy the QRC file to the output directory
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_infile}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${trans_srcfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_srcfile}
|
||||
)
|
||||
|
||||
# Run the resource compiler (rcc_options should already be set)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${trans_file} -o ${trans_outfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_infile}
|
||||
DEPENDS ${QM_FILES}
|
||||
)
|
||||
|
Reference in New Issue
Block a user