Commit 6057d1d0 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Set up Qt4 I18N support in CMake configuration files.

parent df4a1dae
#
# Set locale human-readable translation files.
macro( add_to_qt4_i18n_sources SOURCES)
message( STATUS "Added I18N sources:'${ARGV}'" )
set( i18n_SOURCES ${i18n_SOURCES} ${ARGV} )
endmacro()
......@@ -2,6 +2,8 @@ PROJECT(Monteverdi2)
cmake_minimum_required(VERSION 2.6)
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
#----------------------------------------------------------------------------
# ensure WIN32 definition
if(WIN32)
......@@ -104,9 +106,10 @@ set(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard.")
#----------------------------------------------------------------------------
# Include directories
set(Monteverdi2_INCLUDE_DIRS
${Monteverdi2_SOURCE_DIR}/Code/
# ${Monteverdi2_SOURCE_DIR}/Code/
${Monteverdi2_SOURCE_DIR}/Code/Common
${Monteverdi2_SOURCE_DIR}/Code/Application
#
${Monteverdi2_BINARY_DIR}/Code/Common
${Monteverdi2_BINARY_DIR}/Code/Application
)
......@@ -201,8 +204,31 @@ 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} )
#----------------------------------------------------------------------------
# Include the Packaging subdir after every other dir
# since all other install directives must be executed before fixupbundle
......
......@@ -11,12 +11,49 @@ qt4_wrap_cpp( Application_HEADERS_MOC ${Application_HEADERS} )
qt4_wrap_ui( Application_FORMS_HEADERS ${Application_FORMS} )
qt4_add_resources( Application_RESOURCES_RCC ${Application_RESOURCES} )
#############################################################################
# Qt4 translations.
# Sources files to translate.
add_to_qt4_i18n_sources(
${Application_SOURCES}
${Application_HEADERS}
${Application_FORMS}
${Application_HEADERS_MOC}
${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}
${Application_FORMS_HEADERS}
${Application_HEADERS_MOC}
${Application_RESOURCES_RCC}
${Application_QM_TRANSLATIONS}
)
#############################################################################
......
......@@ -2,3 +2,4 @@
add_subdirectory(Application)
add_subdirectory(Common)
add_subdirectory(i18n)
\ No newline at end of file
......@@ -11,6 +11,18 @@ qt4_wrap_cpp( Common_HEADERS_MOC ${Common_HEADERS} )
qt4_wrap_ui( Common_FORMS_HEADERS ${Common_FORMS} )
qt4_add_resources( Common_RESOURCES_RCC ${Common_RESOURCES} )
########################################################################
# Qt4 translations.
# Sources files to translate.
add_to_qt4_i18n_sources(
${Common_SOURCES}
${Common_HEADERS}
${Common_FORMS}
${Common_HEADERS_MOC}
${Common_FORMS_HEADERS}
)
#############################################################################
add_library(Monteverdi2_Common
${Common_SOURCES}
......
#############################################################################
# Qt4 translations.
#----------------------------------------------------------------------------
# Locale human-readable translation files.
set( Monteverdi2_TS_TRANSLATIONS
fr_FR.UTF-8.ts
)
#
# Sources to translate.
qt4_create_translation( Monteverdi2_QM_TRANSLATIONS
${i18n_SOURCES}
${Monteverdi2_TS_TRANSLATIONS}
)
#
# Locale binary translation files.
qt4_add_translation( Monteverdi2_QM_TRANSLATIONS
${Monteverdi2_TS_TRANSLATIONS}
)
#
# Custom build target.
add_custom_target( i18n DEPENDS ${Monteverdi2_QM_TRANSLATIONS} )
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr_FR">
</TS>
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