Merge topic 'FixGettextPoProcessingWithMultipleDots'
65dde30
FindGettext: two more fixes for files with multiple dotse48fcff
-make GETTEXT_PROCESS_PO_FILES() work with files with multiple dotsecb4459
Strip trailing whitespace
This commit is contained in:
commit
e8fc3bc8d0
|
@ -1,5 +1,5 @@
|
||||||
# - Find GNU gettext tools
|
# - Find GNU gettext tools
|
||||||
# This module looks for the GNU gettext tools. This module defines the
|
# This module looks for the GNU gettext tools. This module defines the
|
||||||
# following values:
|
# following values:
|
||||||
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
|
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
|
||||||
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
|
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
|
||||||
|
@ -7,8 +7,8 @@
|
||||||
#
|
#
|
||||||
# Additionally it provides the following macros:
|
# Additionally it provides the following macros:
|
||||||
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
|
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
|
||||||
# This will create a target "translations" which will convert the
|
# This will create a target "translations" which will convert the
|
||||||
# given input po files into the binary output mo file. If the
|
# given input po files into the binary output mo file. If the
|
||||||
# ALL option is used, the translations will also be created when
|
# ALL option is used, the translations will also be created when
|
||||||
# building the default target.
|
# building the default target.
|
||||||
# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... )
|
# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... )
|
||||||
|
@ -52,7 +52,8 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
|
||||||
SET(_firstPoFile "${_firstPoFileArg}")
|
SET(_firstPoFile "${_firstPoFileArg}")
|
||||||
|
|
||||||
SET(_gmoFiles)
|
SET(_gmoFiles)
|
||||||
GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
|
GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
|
||||||
|
STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
|
||||||
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
|
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
|
||||||
|
|
||||||
SET(_addToAll)
|
SET(_addToAll)
|
||||||
|
@ -92,7 +93,8 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
|
||||||
|
|
||||||
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
|
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
|
GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
|
||||||
|
STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
|
||||||
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
|
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
|
||||||
|
|
||||||
FOREACH (_lang ${_parsedArguments_LANGUAGES})
|
FOREACH (_lang ${_parsedArguments_LANGUAGES})
|
||||||
|
@ -134,7 +136,8 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
|
||||||
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
|
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
|
FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
|
||||||
GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE)
|
GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME)
|
||||||
|
STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
|
||||||
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
|
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
|
ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
|
||||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
||||||
|
|
Loading…
Reference in New Issue