Commit 2cee219d authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: Mantis-1301: still work to do on MERGE TS step

parent 814f577b
......@@ -46,7 +46,7 @@ macro( add_to_qt4_i18n_headers INCLUDE_DIR )
CACHE INTERNAL "" FORCE
)
unset(HEADERS)
foreach( F ${ARGN} )
string( REPLACE ".cxx" ".h" HEADER ${F} )
......@@ -85,7 +85,7 @@ endmacro()
#
#
macro( generate_qt4_project TRANSLATIONS FILENAME )
macro( generate_qt4_project FILENAME )
message( STATUS "Generating Qt4 '${FILENAME}' project file for I18N." )
file( WRITE
......@@ -100,7 +100,6 @@ HEADERS = ${OTB_QT_I18N_HEADER_FILES}
SOURCES = ${OTB_QT_I18N_SOURCE_FILES}
FORMS = ${OTB_QT_I18N_FORM_FILES}
TRANSLATIONS = ${TRANSLATIONS}"
"
)
endmacro()
......@@ -6,6 +6,7 @@ set( OTB_TS_TRANSLATIONS
# en_US.ts
fr_FR.ts
)
unset(OTB_QM_TRANSLATIONS)
#----------------------------------------------------------------------------
# Configuration option to enable creation/merging of source .ts files
......@@ -28,20 +29,28 @@ if( OTBQt4_ENABLED )
set( OTB_QT_I18N_PRO "${CMAKE_CURRENT_BINARY_DIR}/i18n.pro" )
generate_qt4_project( ${OTB_TS_TRANSLATIONS} ${OTB_QT_I18N_PRO} )
generate_qt4_project( ${OTB_QT_I18N_PRO} )
qt4_create_translation( OTB_QM_TRANSLATIONS
${OTB_QT_I18N_PRO}
${OTB_TS_TRANSLATIONS}
)
foreach(_ts_name ${OTB_TS_TRANSLATIONS})
get_filename_component(_abs_ts ${_ts_name} ABSOLUTE)
message( STATUS "Merge TS : ${_abs_ts}")
add_custom_command(OUTPUT ${_abs_ts}
COMMAND ${QT_LUPDATE_EXECUTABLE}
ARGS -locations none -pro ${OTB_QT_I18N_PRO} -ts ${_abs_ts}
DEPENDS
#${OTB_QT_I18N_HEADER_FILES}
#${OTB_QT_I18N_SOURCE_FILES}
#${OTB_QT_I18N_FORM_FILES}
${OTB_QT_I18N_PRO}
VERBATIM)
endforeach()
endif()
else()
qt4_add_translation( OTB_QM_TRANSLATIONS
qt4_add_translation(OTB_QM_TRANSLATIONS
${OTB_TS_TRANSLATIONS}
)
endif()
# Custom build targets.
add_custom_target( i18n ALL DEPENDS i18n_qt )
add_custom_target( i18n_qt DEPENDS ${OTB_QM_TRANSLATIONS} )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment