Skip to content
Snippets Groups Projects
Commit 52f937ae authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Upgraded Qt4 I18N support in CMake configuration files.

parent 6057d1d0
No related branches found
No related tags found
No related merge requests found
#
# Set locale human-readable translation files.
macro( add_to_qt4_i18n_sources SOURCES)
message( STATUS "Added I18N sources:'${ARGV}'" )
# message( STATUS "Added I18N sources:'${ARGV}'" )
set( i18n_SOURCES ${i18n_SOURCES} ${ARGV} )
endmacro()
......@@ -2,7 +2,10 @@ PROJECT(Monteverdi2)
cmake_minimum_required(VERSION 2.6)
#----------------------------------------------------------------------------
# Modules
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
include( i18n_qt4 )
#----------------------------------------------------------------------------
# ensure WIN32 definition
......@@ -204,30 +207,8 @@ endif("${_PREFIX}" STREQUAL "${_BUILD}")
#----------------------------------------------------------------------------
# Code location
include( i18n_qt4 )
add_subdirectory(Code)
#############################################################################
# Qt4 translations.
#----------------------------------------------------------------------------
# Locale human-readable translation files.
# set( Monteverdi2_TS_TRANSLATIONS
# Code/i18n/fr_FR.UTF-8.ts
# )
# #
# # Sources to translate.
# qt4_create_translation( i18n/Monteverdi2_QM_TRANSLATIONS
# ${i18n_SOURCES}
# ${Monteverdi2_TS_TRANSLATIONS}
# )
# #
# # Locale binary translation files.
# qt4_add_translation( i18n/Monteverdi2_QM_TRANSLATIONS
# ${Monteverdi2_TS_TRANSLATIONS}
# )
# #
# # Custom build target.
# add_custom_target( i18n DEPENDS ${Monteverdi2_QM_TRANSLATIONS} )
add_subdirectory( Code )
add_subdirectory( i18n )
#----------------------------------------------------------------------------
# Include the Packaging subdir after every other dir
......
......@@ -23,30 +23,6 @@ add_to_qt4_i18n_sources(
${Application_FORMS_HEADERS}
)
# set( Application_I18N_SOURCES
# ${Application_SOURCES}
# ${Application_HEADERS}
# ${Application_FORMS}
# ${Application_HEADERS_MOC}
# ${Application_FORMS_HEADERS}
# )
# # Locale human-readable translation files.
# set( Application_TS_TRANSLATIONS
# i18n/fr_FR.UTF-8.ts
# )
# # Sources to translate.
# qt4_create_translation( Application_QM_TRANSLATIONS
# ${Application_I18N_SOURCES}
# ${Application_TS_TRANSLATIONS}
# )
# # Locale binary translation files.
# qt4_add_translation( Application_QM_TRANSLATIONS
# ${Application_TS_TRANSLATIONS}
# )
#############################################################################
add_executable(monteverdi2
${Application_SOURCES}
......
......@@ -2,4 +2,3 @@
add_subdirectory(Application)
add_subdirectory(Common)
add_subdirectory(i18n)
\ No newline at end of file
......@@ -3,14 +3,20 @@
#----------------------------------------------------------------------------
# Locale human-readable translation files.
set( Monteverdi2_TS_TRANSLATIONS
fr_FR.UTF-8.ts
fr_FR.ts
)
#
# Configuration option to enable creation/merging of source .ts files
# Default value is: OFF.
option( MERGE_TS_TRANSLATIONS "Create/merge .ts source translation files. WARNING: 'make clean' will delete the source .ts files!.")
#
# Sources to translate.
qt4_create_translation( Monteverdi2_QM_TRANSLATIONS
${i18n_SOURCES}
${Monteverdi2_TS_TRANSLATIONS}
)
if( MERGE_TS_TRANSLATIONS )
qt4_create_translation( Monteverdi2_QM_TRANSLATIONS
${i18n_SOURCES}
${Monteverdi2_TS_TRANSLATIONS}
)
endif( MERGE_TS_TRANSLATIONS )
#
# Locale binary translation files.
qt4_add_translation( Monteverdi2_QM_TRANSLATIONS
......@@ -18,4 +24,13 @@ qt4_add_translation( Monteverdi2_QM_TRANSLATIONS
)
#
# Custom build target.
add_custom_target( i18n DEPENDS ${Monteverdi2_QM_TRANSLATIONS} )
add_custom_target( i18n ALL DEPENDS ${Monteverdi2_QM_TRANSLATIONS} )
#
#----------------------------------------------------------------------------
# Locale human-readable translation files.
# if( NOT OTB_INSTALL_NO_LIBRARIES )
# install(
# TARGETS i18n
# FILES DESTINATION ${}
# )
# endif( NOT OTB_INSTALL_NO_LIBRARIES )
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment