Commit 4aff799c authored by barraud's avatar barraud
Browse files

FEATURE 565 Add EXTRA_LANGUAGE functionnality to camitk_translate() macro.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1792 ec899d31-69d1-42ba-9299-647d76f65fb3
parent f38d14a4
......@@ -35,6 +35,7 @@
#! [ADDITIONAL_SOURCES source.cxx source.cpp ...]
#! [INCLUDE_DIRECTORIES dir1 dir2 ...]
#! [EXTERNAL_LIBRARIES lib1 lib2 ...]
#! [EXTRA_TRANSLATE_LANGUAGE]
#! )
#! \endcode
#!
......@@ -52,6 +53,7 @@
#! \param DESCRIPTION Simple description of the application. Used for packaging presentation for instance.
#! \param INCLUDE_DIRECTORIES additional include directories
#! \param EXTERNAL_LIBRARIES external libraries to add to the link command
#! \param EXTRA_TRANSLATE_LANGUAGE Additionnal extra language to translate the application
macro(camitk_application)
#########################################################################
......@@ -66,7 +68,7 @@ macro(camitk_application)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} APPLICATION_NAME)
parse_arguments(${APPLICATION_NAME_CMAKE}
"NEEDS_CEP_LIBRARIES;NEEDS_TOOL;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;DEFINES;CXX_FLAGS;ADDITIONAL_SOURCES;CEP_NAME;DESCRIPTION;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES" # possible lists
"NEEDS_CEP_LIBRARIES;NEEDS_TOOL;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;DEFINES;CXX_FLAGS;ADDITIONAL_SOURCES;CEP_NAME;DESCRIPTION;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES;EXTRA_TRANSLATE_LANGUAGE" # possible lists
"DISABLED;NEEDS_QT_MODULES;NEEDS_ITK;NEEDS_QTXML;NEEDS_XSD;NEEDS_XERCESC;NEEDS_PYTHON" # possible options
${ARGN}
)
......@@ -970,8 +972,11 @@ macro(camitk_application)
# images #
# #
#########################################################################
camitk_translate()
if(${APPLICATION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE)
camitk_translate(EXTRA_LANGUAGE ${${APPLICATION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
else()
camitk_translate()
endif()
#########################################################################
......
......@@ -30,6 +30,7 @@
#! [TARGET_NAME non-default-targetname]
#! [TEST_APPLICATION application-name]
#! [DESCRIPTION description]
#! [EXTRA_TRANSLATE_LANGUAGE]
#! )
#! \endcode
#!
......@@ -69,6 +70,7 @@
#! No CEP_NAME provided will result in default categorization (generic extension).
#! \param TEST_APPLICATION = The name of the application to provide for generate automatic basic tests on your extension. No option means no tests!
#! \param DESCRIPTION = Simple description of the extension. Used for packaging presentation for instance.
#! \param EXTRA_TRANSLATE_LANGUAGE = Additionnal extra language to translate the application
macro(camitk_extension)
......@@ -84,7 +86,7 @@ macro(camitk_extension)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} EXTENSION_NAME)
parse_arguments(${EXTENSION_NAME_CMAKE} #prefix
"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;TEST_APPLICATION" # possible lists
"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;TEST_APPLICATION;EXTRA_TRANSLATE_LANGUAGE" # possible lists
"NEEDS_QT_MODULES;ACTION_EXTENSION;COMPONENT_EXTENSION;DISABLED;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_QTXML;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS;NEEDS_GDCM;DISABLE_TESTLEVEL1;DISABLE_TESTLEVEL2;DISABLE_TESTLEVEL3" # possible options
${ARGN}
)
......@@ -1364,12 +1366,22 @@ macro(camitk_extension)
# images #
# #
#########################################################################
if(${EXTENSION_NAME} STREQUAL "application")
camitk_translate(USE_FLAGS) # Build the flags.qrc only for this action
if(${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE)
if(${EXTENSION_NAME} STREQUAL "application")
camitk_translate(USE_FLAGS
EXTRA_LANGUAGE ${${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE}
)
else()
camitk_translate(EXTRA_LANGUAGE ${${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
endif()
else()
camitk_translate()
if(${EXTENSION_NAME} STREQUAL "application")
camitk_translate(USE_FLAGS)
else()
camitk_translate()
endif()
endif()
#########################################################################
......
......@@ -30,6 +30,7 @@
#! [HEADERS_TO_INSTALL]
#! [CEP_NAME]
#! [DESCRIPTION]
#! [EXTRA_TRANSLATE_LANGUAGE]
#!
#! )
#! \endcode
......@@ -56,6 +57,7 @@
#! \param CEP_NAME specify the CEP_NAME, which is used to categorized the extension for packaging purpose
#! No CEP_NAME provided will result in default categorization (generic extension).
#! \param DESCRIPTION Simple description of the extension. Used for packaging presentation for instance.
#! \param EXTRA_TRANSLATE_LANGUAGE Additionnal extra language to translate the application
macro(camitk_library)
......@@ -71,7 +73,7 @@ macro(camitk_library)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} DEFAULT_LIBRARY_NAME)
parse_arguments(${DEFAULT_LIBRARY_NAME_CMAKE}
"SOURCES;NEEDS_CEP_LIBRARIES;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES;LIBNAME;DEFINES;LINK_DIRECTORIES;HEADERS_TO_INSTALL;CEP_NAME;DESCRIPTION;" # possible lists
"SOURCES;NEEDS_CEP_LIBRARIES;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES;LIBNAME;DEFINES;LINK_DIRECTORIES;HEADERS_TO_INSTALL;CEP_NAME;DESCRIPTION;EXTRA_TRANSLATE_LANGUAGE" # possible lists
"SHARED;STATIC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XERCESC;NEEDS_XSD;NEEDS_QT_MODULES;PUBLIC" # possible options
${ARGN}
)
......@@ -959,7 +961,11 @@ macro(camitk_library)
# images #
# #
#########################################################################
camitk_translate()
if(${DEFAULT_LIBRARY_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE)
camitk_translate(EXTRA_LANGUAGE ${${DEFAULT_LIBRARY_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
else()
camitk_translate()
endif()
......
......@@ -12,21 +12,27 @@
#! usage:
#! \code
#! camitk_translate(
#! [EXTRA_LANGUAGE]
#! [USE_FLAGS]
#! )
#! \endcode
#!
#! \param EXTRA_LANGUAGE optional, allows the translation of this additional language
#! \param USE_FLAGS optional, use the flag directory to associate a flag per language
macro(camitk_translate)
parse_arguments(CAMITK_TRANSLATION
"" # possible lists
"EXTRA_LANGUAGE" # possible lists
"USE_FLAGS" # possible options
${ARGN}
)
#insert here your new language _xx
set(CAMITK_TRANSLATIONS _en_fr)
if(CAMITK_TRANSLATION_EXTRA_LANGUAGE)
set(CAMITK_TRANSLATIONS ${CAMITK_TRANSLATIONS}_${CAMITK_TRANSLATION_EXTRA_LANGUAGE})
endif()
#create translate.pro file
file (GLOB HEADER_FILES *.h *.hpp)
......
Supports Markdown
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