-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
76 lines (56 loc) · 3 KB
/
CMakeLists.txt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
project(nowdockpanel)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set (CMAKE_CXX_STANDARD 11)
set(VERSION 0.5.0)
set(AUTHOR "Michail Vourlakos")
set(EMAIL "[email protected]")
set(WEBSITE "https://store.kde.org/p/1154578/")
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(KF5Plasma)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
MESSAGE(
"------
NOTE: msgfmt not found. Translations will *not* be installed
------")
ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
SET(catalogname plasma_applet_org.kde.store.nowdock.panel)
ADD_CUSTOM_TARGET(translations ALL)
FILE(GLOB PO_FILES po/nowdockpanel/*.po)
FOREACH(_poFile ${PO_FILES})
GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} )
STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} )
IF( _langCode )
GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/nowdockpanel/${_lang}.gmo)
ADD_CUSTOM_COMMAND(TARGET translations
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
DEPENDS ${_poFile})
INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
ENDIF( _langCode )
ENDFOREACH(_poFile ${PO_FILES})
SET(catalogname2 plasma_applet_org.kde.store.nowdock.plasmoid)
ADD_CUSTOM_TARGET(translations2 ALL)
FILE(GLOB PO_FILES2 po/nowdockplasmoid/*.po)
FOREACH(_poFile ${PO_FILES2})
GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
STRING(REGEX REPLACE "^${catalogname2}_?" "" _langCode ${_poFileName} )
STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} )
IF( _langCode )
GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/nowdockplasmoid/${_lang}.gmo)
ADD_CUSTOM_COMMAND(TARGET translations2
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
DEPENDS ${_poFile})
INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname2}.mo)
ENDIF( _langCode )
ENDFOREACH(_poFile ${PO_FILES})
ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)
add_subdirectory(libnowdock)
add_subdirectory(nowdockpanel)
plasma_install_package(build/nowdockpanel/release org.kde.store.nowdock.panel)
add_subdirectory(nowdockplasmoid)
plasma_install_package(build/nowdockplasmoid/release org.kde.store.nowdock.plasmoid)
add_subdirectory(layout-templates)