forked from elementary/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
115 lines (93 loc) · 3.9 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
107
108
109
110
111
112
113
114
115
# Check http://elementaryos.org/docs/code/the-build-system for documentation
project (io.elementary.terminal C)
cmake_minimum_required (VERSION 2.8)
cmake_policy (VERSION 2.6)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#
# Base bits
#
enable_testing ()
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set (PKGDATADIR "${DATADIR}/io.elementary.terminal")
set (GETTEXT_PACKAGE "io.elementary.terminal")
set (RELEASE_NAME "Fast and connected.")
set (VERSION "0.4.3")
set (VERSION_INFO "Release")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
# Comment this out to enable C compiler warnings
add_definitions (-w)
# Add 'make dist' command for creating release tarball
set (CPACK_PACKAGE_VERSION ${VERSION})
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}")
include (CPack)
add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
# Add 'make uninstall' command to remove installed files
configure_file(
"${CMAKE_SOURCE_DIR}/cmake/Uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/Uninstall.cmake)
find_package (PkgConfig)
pkg_check_modules (DEPS REQUIRED
gthread-2.0
gtk+-3.0>=3.9.10
granite>=0.3.0
glib-2.0>=2.39
vte-2.91
gdk-3.0)
add_definitions (${DEPS_CFLAGS})
# Work around http://www.cmake.org/Bug/view.php?id=12928:
# CMake ignores CPPFLAGS where Debian and Ubuntu pass their hardening options.
# See the bug linked above and https://wiki.debian.org/Hardening for more info.
add_definitions (${CPPFLAGS})
link_libraries (${DEPS_LIBRARIES})
link_directories (${DEPS_LIBRARY_DIRS})
find_package (Vala REQUIRED)
include (ValaVersion)
ensure_vala_version ("0.22.0" MINIMUM)
include (ValaPrecompile)
vala_precompile (VALA_C
src/Application.vala
src/Constants.vala
src/DBus.vala
src/Settings.vala
src/PantheonTerminalWindow.vala
src/Dialogs/ForegroundProcessDialog.vala
src/Dialogs/UnsafePasteDialog.vala
src/Widgets/SearchToolbar.vala
src/Widgets/TerminalWidget.vala
PACKAGES
vte-2.91
granite
gtk+-3.0
gdk-3.0
posix
CUSTOM_VAPIS
vapi/config.vapi
OPTIONS
--thread
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
)
include (GSettings)
add_schema ("data/io.elementary.terminal.gschema.xml")
#link_libraries (m)
add_subdirectory (po)
add_executable (io.elementary.terminal ${VALA_C})
find_library (M_LIB m)
target_link_libraries (io.elementary.terminal ${M_LIB})
include (Translations)
configure_file_translation(${CMAKE_SOURCE_DIR}/data/open-pantheon-terminal-here.desktop.in ${CMAKE_BINARY_DIR}/data/open-pantheon-terminal-here.desktop ${CMAKE_SOURCE_DIR}/po/)
configure_file_translation(${CMAKE_SOURCE_DIR}/data/org.pantheon.terminal.desktop.in ${CMAKE_BINARY_DIR}/data/org.pantheon.terminal.desktop ${CMAKE_SOURCE_DIR}/po/)
configure_file_translation(${CMAKE_SOURCE_DIR}/data/io.elementary.terminal.appdata.xml.in ${CMAKE_BINARY_DIR}/data/io.elementary.terminal.appdata.xml ${CMAKE_SOURCE_DIR}/po/)
install (TARGETS io.elementary.terminal RUNTIME DESTINATION bin)
install (FILES ${CMAKE_BINARY_DIR}/data/org.pantheon.terminal.desktop DESTINATION share/applications)
install (FILES ${CMAKE_BINARY_DIR}/data/io.elementary.terminal.appdata.xml DESTINATION share/metainfo)
install (FILES ${CMAKE_BINARY_DIR}/data/open-pantheon-terminal-here.desktop DESTINATION share/applications)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/enable-zsh-completion-notifications DESTINATION share/io.elementary.terminal)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/enable-fish-completion-notifications DESTINATION share/io.elementary.terminal)