-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
76 lines (61 loc) · 2.01 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
cmake_minimum_required(VERSION 3.13)
project(xfce4-hamster-plugin
VERSION 1.18
DESCRIPTION "A recreation of the gnome hamster shell extension for the xfce4 panel"
LANGUAGES C
)
find_package(PkgConfig REQUIRED)
find_package(Gettext REQUIRED)
find_package(Intl REQUIRED)
include(GNUInstallDirs)
pkg_check_modules(GTK REQUIRED
libxfce4panel-2.0
libxfce4ui-2
libxfconf-0
)
find_program(GDBUSCODEGEN NAMES gdbus-codegen)
if (NOT GDBUSCODEGEN)
message(SEND_ERROR "Could not find gdbus-codegen")
endif()
find_program(INTLTOOLUPDATE NAMES intltool-update)
if (NOT INTLTOOLUPDATE)
message(SEND_ERROR "Could not find intltool-update")
endif()
find_program(INTLTOOLMERGE NAMES intltool-merge)
if (NOT INTLTOOLMERGE)
message(SEND_ERROR "Could not find intltool-merge")
endif()
set(POT ${CMAKE_CURRENT_LIST_DIR}/po/${PROJECT_NAME}.pot)
add_custom_command(OUTPUT ${POT}
COMMAND cd ${CMAKE_CURRENT_LIST_DIR}/po && ${INTLTOOLUPDATE} -p -g ${PROJECT_NAME}
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hamster.desktop
COMMAND ${INTLTOOLMERGE} -d ${PROJECT_SOURCE_DIR}/po ${PROJECT_SOURCE_DIR}/panel-plugin/hamster.desktop.in ${PROJECT_BINARY_DIR}/hamster.desktop
DEPENDS ${PROJECT_SOURCE_DIR}/panel-plugin/hamster.desktop.in translations
)
add_subdirectory(
panel-plugin
)
gettext_create_translations(
po/${PROJECT_NAME}.pot ALL
po/cs.po
po/de.po
po/es.po
po/ru.po
po/tr.po
po/uk.po
)
configure_file(
${PROJECT_SOURCE_DIR}/panel-plugin/xfce4-popup-hamstermenu.sh
${PROJECT_BINARY_DIR}/xfce4-popup-hamstermenu
)
add_custom_target(
data ALL
DEPENDS
${POT}
${PROJECT_BINARY_DIR}/hamster.desktop
${PROJECT_BINARY_DIR}/xfce4-popup-hamstermenu
)
install(TARGETS hamster LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/xfce4/panel/plugins/)
install(FILES ${PROJECT_BINARY_DIR}/hamster.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xfce4/panel/plugins/)
install(PROGRAMS ${PROJECT_BINARY_DIR}/xfce4-popup-hamstermenu DESTINATION ${CMAKE_INSTALL_BINDIR})