1 # Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # @file CMakeLists.txt
16 # @author Adam Malinowski <a.malinowsk2@partner.samsung.com>
23 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
24 SET(SHAREDIR "${PREFIX}/share")
25 SET(LOCALEDIR "${SHAREDIR}/locale")
26 SET(MSGFMT "/usr/bin/msgfmt")
28 FOREACH(pofile ${POFILES})
29 SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
30 MESSAGE("PO: ${pofile}")
31 GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
32 GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
33 SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
36 COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
39 INSTALL(FILES ${moFile}
40 DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
41 SET(moFiles ${moFiles} ${moFile})
44 ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})