forked from p-e-w/finalterm
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
120 lines (104 loc) · 3.7 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
116
117
118
119
120
project(finalterm C)
cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
option(MINIMAL_FLAGS "Respect system flags as much as possible" OFF)
set(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set(PKGDATADIR "${DATADIR}/finalterm")
set(VERSION 0.1)
set(GETTEXT_PACKAGE "finalterm")
set(LOCALE_DIR "${DATADIR}/locale")
set(VALAFLAGS "")
if (NOT MINIMAL_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb")
endif (NOT MINIMAL_FLAGS)
configure_file(${CMAKE_SOURCE_DIR}/data/Startup/bash_startup.in ${CMAKE_BINARY_DIR}/Startup/bash_startup @ONLY)
set(PKGS gtk+-3.0 keybinder-3.0 gee-0.8 json-glib-1.0)
find_package(PkgConfig)
# see if we got libunity
pkg_check_modules(UNITY unity)
if (UNITY_FOUND)
set(VALAFLAGS ${VALAFLAGS}
--define=HAS_UNITY)
set(PKGS ${PKGS}
unity)
endif (UNITY_FOUND)
# see if we got libnotify
pkg_check_modules(NOTIFY libnotify)
if (NOTIFY_FOUND)
set(VALAFLAGS ${VALAFLAGS}
--define=HAS_NOTIFY)
set(PKGS ${PKGS}
libnotify)
endif (NOTIFY_FOUND)
pkg_check_modules(DEPS REQUIRED ${PKGS})
add_definitions(${DEPS_CFLAGS})
add_definitions(-DPKGDATADIR=\"${PKGDATADIR}\")
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
add_definitions(-DLOCALE_DIR=\"${LOCALE_DIR}\")
add_definitions(-DVERSION=\"${VERSION}\")
link_libraries(${DEPS_LIBRARIES})
link_directories(${DEPS_LIBRARY_DIRS})
find_package(Vala REQUIRED)
include(ValaVersion)
ensure_vala_version("0.25.1" MINIMUM)
include(ValaPrecompile)
vala_precompile(VALA_C
src/FinalTerm.vala
src/Terminal.vala
src/TerminalStream.vala
src/Encoder.vala
src/TerminalOutput.vala
src/CharacterAttributes.vala
src/TerminalView.vala
src/TextView.vala
src/TerminalWidget.vala
src/NestingContainer.vala
src/Autocompletion.vala
src/NotifyingList.vala
src/ScrollableTreeView.vala
src/Utilities.vala
src/SettingsWindow.vala
src/TextMenu.vala
src/ColorScheme.vala
src/Theme.vala
src/KeyBindings.vala
src/Command.vala
src/Settings.vala
src/Metrics.vala
src/StatusBar.vala
PACKAGES
${PKGS}
posix
linux
Config
OPTIONS
-g
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
${VALAFLAGS}
)
add_subdirectory (po)
include(GSettings)
add_schema ("data/org.gnome.finalterm.gschema.xml")
include(Common)
datestring(DATE "%B %Y")
configure_file(${CMAKE_SOURCE_DIR}/data/finalterm.1.in ${CMAKE_BINARY_DIR}/data/finalterm.1)
install(FILES ${CMAKE_BINARY_DIR}/data/finalterm.1 DESTINATION share/man/man1)
add_executable(finalterm ${VALA_C})
target_link_libraries(finalterm m util)
install(TARGETS finalterm RUNTIME DESTINATION bin)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/ColorSchemes DESTINATION share/finalterm)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/KeyBindings DESTINATION share/finalterm)
install(DIRECTORY ${CMAKE_BINARY_DIR}/Startup DESTINATION share/finalterm)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/Startup/preexec.bash DESTINATION share/finalterm/Startup)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/TerminalCommands DESTINATION share/finalterm)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/Termlets DESTINATION share/finalterm FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/TextMenus DESTINATION share/finalterm)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/Themes DESTINATION share/finalterm)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/Icons/hicolor DESTINATION share/icons)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -D "GSETTINGS_COMPILE:BOOL=${GSETTINGS_COMPILE}"
-D "GSETTINGS_DIR:FILEPATH=${GSETTINGS_DIR}"
-D "_glib_comple_schemas:FILEPATH=${_glib_comple_schemas}"
-P "${CMAKE_SOURCE_DIR}/cmake/Uninstall.cmake"
)