1 # Copyright (c) 2015.3017 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>
104 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
105 SET(SHAREDIR "${PREFIX}/share")
106 SET(LOCALEDIR "${SHAREDIR}/locale")
107 SET(MSGFMT "/usr/bin/msgfmt")
109 FOREACH(pofile ${POFILES})
110 SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
111 MESSAGE("PO: ${pofile}")
112 GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
113 GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
114 SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
117 COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
120 INSTALL(FILES ${moFile}
121 DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${TARGET_ASKUSER_NOTIFICATION}.mo)
122 SET(moFiles ${moFiles} ${moFile})
125 ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})