1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-22 05:33:32 +02:00

qt5: cmake: allow building Tomahawk against Qt4 and Qt5

This commit is contained in:
Dominik Schmidt
2013-01-06 03:52:20 +01:00
parent 033e6a3059
commit 110fb0100d
10 changed files with 146 additions and 116 deletions

View File

@@ -21,25 +21,25 @@ macro(add_tomahawk_translations language)
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
QT4_ADD_TRANSLATION( QM_FILES ${TS_FILES} )
qt_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_BINARY_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 )
set( trans_file tomahawk_i18n )
set( trans_srcfile ${CMAKE_BINARY_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(
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(
add_custom_command(
OUTPUT ${trans_outfile}
COMMAND ${QT_RCC_EXECUTABLE}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} -name ${trans_file} -o ${trans_outfile} ${trans_infile}
MAIN_DEPENDENCY ${trans_infile}
DEPENDS ${QM_FILES}