-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
106 lines (93 loc) · 3.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 3.5)
project(roxterm C)
include(FindPkgConfig)
include(GNUInstallDirs)
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/version.sh
OUTPUT_VARIABLE ROXTERM_VERSION)
execute_process(COMMAND date "+%Y-%m-%d"
OUTPUT_VARIABLE ROXTERM_DATE)
set(APPINFO_VERSION "${ROXTERM_VERSION} ${ROXTERM_DATE}")
configure_file(${PROJECT_SOURCE_DIR}/AppInfo.xml.in
${PROJECT_SOURCE_DIR}/AppInfo.xml)
# metainfo should really be processed by i18n
configure_file(${PROJECT_SOURCE_DIR}/roxterm.metainfo.xml.in
${PROJECT_BINARY_DIR}/roxterm.metainfo.xml)
configure_file(${PROJECT_SOURCE_DIR}/roxterm.spec.in
${PROJECT_SOURCE_DIR}/roxterm.spec)
configure_file(${PROJECT_SOURCE_DIR}/roxterm.1.xml.in
${PROJECT_BINARY_DIR}/roxterm.1.xml)
configure_file(${PROJECT_SOURCE_DIR}/roxterm-config.1.xml.in
${PROJECT_BINARY_DIR}/roxterm-config.1.xml)
add_subdirectory(src)
install(FILES src/icons/roxterm.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
install(DIRECTORY Config
DESTINATION ${CMAKE_INSTALL_DATADIR}/roxterm)
install(DIRECTORY docs/
DESTINATION ${CMAKE_INSTALL_DOCDIR})
find_program(XSLTPROC xsltproc)
if (NOT "${XSLTPROC}" EQUAL "XSLTPROC-NOTFOUND")
set(XSLTPROC_OPTIONS --novalid --param man.charmap.use.subset 0
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl)
add_custom_command(OUTPUT roxterm.1
COMMAND ${XSLTPROC} -o roxterm.1 ${XSLTPROC_OPTIONS}
${PROJECT_BINARY_DIR}/roxterm.1.xml
MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/roxterm.1.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(OUTPUT roxterm-config.1
COMMAND ${XSLTPROC} -o roxterm-config.1 ${XSLTPROC_OPTIONS}
${PROJECT_BINARY_DIR}/roxterm-config.1.xml
MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/roxterm-config.1.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(manpages ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/roxterm.1
${CMAKE_CURRENT_BINARY_DIR}/roxterm-config.1)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/roxterm.1
${CMAKE_CURRENT_BINARY_DIR}/roxterm-config.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
else ()
message(WARNING "xsltproc not found, man pages will not be generated")
endif ()
install(FILES roxterm.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/roxterm.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
# It would be nice if we could use cmake -E tar here, but it doesn't support
# any of the -- options needed here.
set(ROXTERM_PACKAGE_NAME "${CMAKE_PROJECT_NAME}-${ROXTERM_VERSION}")
set(TARBALL_NAME "${ROXTERM_PACKAGE_NAME}.tar.xz")
add_custom_command(OUTPUT "${TARBALL_NAME}"
COMMAND tar cfJ
"${TARBALL_NAME}"
"--directory=${PROJECT_SOURCE_DIR}"
"--transform=s,^,${CMAKE_PROJECT_NAME}-${ROXTERM_VERSION}/,"
"--exclude=*~"
AppInfo.xml
AppInfo.xml.in
AppRun
AUTHORS
CMakeLists.txt
Config
COPYING
COPYING-LGPL
docs
INSTALL
INSTALL.Debian
mkycmflags
NEWS
README
README.md
README.translations
roxterm.1.xml.in
roxterm.metainfo.xml.in
roxterm-config.1.xml.in
roxterm.desktop
roxterm.lsm.in
roxterm.spec
roxterm.spec.in
roxterm.xml
src
version
version.sh)
add_custom_target(dist DEPENDS "${TARBALL_NAME}")