Add notification daemon
[platform/core/security/askuser.git] / src / agent / notification-daemon / po / CMakeLists.txt
1 # Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
2 #
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
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 #
15 # @file        CMakeLists.txt
16 # @author      Adam Malinowski <a.malinowsk2@partner.samsung.com>
17 #
18
19 SET(POFILES
20     en.po pl.po
21 )
22
23 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
24 SET(SHAREDIR "${PREFIX}/share")
25 SET(LOCALEDIR "${SHAREDIR}/locale")
26 SET(MSGFMT "/usr/bin/msgfmt")
27
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)
34     ADD_CUSTOM_COMMAND(
35         OUTPUT ${moFile}
36         COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
37         DEPENDS ${absPofile}
38     )
39     INSTALL(FILES ${moFile}
40         DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
41     SET(moFiles ${moFiles} ${moFile})
42 ENDFOREACH(pofile)
43
44 ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})