[5b2eaf]: cmake / modules / FindMSGFMT.cmake  Maximize  Restore  History

Download this file

50 lines (48 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
# Find the msgfmt program
#
# Modified from Rosegarden project
#
# Defined variables:
# MSGFMT_FOUND
# MSGFMT_EXECUTABLE
#
# Macro:
# ADD_TRANSLATIONS
#
IF(MSGFMT_EXECUTABLE)
SET(MSGFMT_FOUND TRUE)
ELSE(MSGFMT_EXECUTABLE)
FIND_PROGRAM(MSGFMT_EXECUTABLE
NAMES msgfmt gmsgfmt
PATHS /bin /usr/bin /usr/local/bin )
IF(MSGFMT_EXECUTABLE)
SET(MSGFMT_FOUND TRUE)
ELSE(MSGFMT_EXECUTABLE)
IF(NOT MSGFMT_FIND_QUIETLY)
IF(MSGFMT_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "msgfmt program couldn't be found")
ENDIF(MSGFMT_FIND_REQUIRED)
ENDIF(NOT MSGFMT_FIND_QUIETLY)
ENDIF(MSGFMT_EXECUTABLE)
MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
ENDIF (MSGFMT_EXECUTABLE)
IF(MSGFMT_FOUND)
MESSAGE(STATUS "Found msgfmt: ${MSGFMT_EXECUTABLE}")
ENDIF(MSGFMT_FOUND)
MACRO(ADD_TRANSLATIONS _lang)
SET(_outputs)
FOREACH(_file ${ARGN})
GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
SET(_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.mo")
SET(_in "${CMAKE_CURRENT_SOURCE_DIR}/${_file_we}.po")
ADD_CUSTOM_COMMAND(
OUTPUT ${_out}
COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
DEPENDS ${_in} )
INSTALL(FILES ${_out}
DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES )
SET(_outputs ${_outputs} ${_out})
ENDFOREACH(_file)
ADD_CUSTOM_TARGET(translations ALL DEPENDS ${_outputs})
ENDMACRO(ADD_TRANSLATIONS)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks