-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
157 lines (141 loc) · 4.38 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
cmake_minimum_required(VERSION 3.0.2)
# Eovim's version works in two different modes:
# (1) major.minor.patch (semver) for stable (released) sources
# (2) major.minor.patch.99 for development (nightly) sources
#
# When a tweak revision (i.e. 99) is added to normal semver (1), Eovim
# considers it is in a development stage. It will automatically add the (short)
# git hash of Eovim to its version, if the sources are from a git repository.
project(eovim LANGUAGES C VERSION 0.2.0.99)
include(CheckTypeSize)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH
"${CMAKE_MODULE_PATH}${CMAKE_SOURCE_DIR}/cmake/Modules")
option(WITH_WERROR "Treat compiler warnings as errors" OFF)
include(compiler_warnings)
include(git_commit)
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(THEMES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data/themes")
set(BUILD_THEMES_DIR "${CMAKE_BINARY_DIR}/themes")
set(BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")
file(MAKE_DIRECTORY "${BUILD_THEMES_DIR}")
file(MAKE_DIRECTORY "${BUILD_INCLUDE_DIR}/eovim")
configure_file(
"${CMAKE_SOURCE_DIR}/cmake/Modules/version.h.in"
"${BUILD_INCLUDE_DIR}/eovim/version.h"
@ONLY)
# CPack configuration
include(cpack_config)
find_package(Efl 1.19 REQUIRED COMPONENTS
eina eet edje ecore-file ecore-input edje evas efreet elementary)
find_program(EDJE_CC_EXECUTABLE edje_cc)
if (NOT EDJE_CC_EXECUTABLE)
message(FATAL_ERROR "Failed to find edje_cc program")
endif ()
find_package(MsgPack REQUIRED)
add_custom_command(
OUTPUT "${BUILD_THEMES_DIR}/default.edj"
DEPENDS
"${THEMES_DIR}/default.edc"
"${THEMES_DIR}/cursor.edc"
"${THEMES_DIR}/cmdline.edc"
"${THEMES_DIR}/completion.edc"
"${THEMES_DIR}/tab.edc"
VERBATIM
COMMAND
"${EDJE_CC_EXECUTABLE}"
"${THEMES_DIR}/default.edc"
"${BUILD_THEMES_DIR}/default.edj"
-author "${CMAKE_SOURCE_DIR}/AUTHORS"
-license "${CMAKE_SOURCE_DIR}/LICENSE"
-id "${THEMES_DIR}/img"
-sd "${THEMES_DIR}/snd"
COMMENT "Generating Edje Theme"
)
add_custom_target(themes
DEPENDS "${BUILD_THEMES_DIR}/default.edj"
)
add_executable(eovim
"${SRC_DIR}/main.c"
"${SRC_DIR}/nvim.c"
"${SRC_DIR}/keymap.c"
"${SRC_DIR}/gui/gui.c"
"${SRC_DIR}/gui/cmdline.c"
"${SRC_DIR}/gui/cursor.c"
"${SRC_DIR}/gui/termview.c"
"${SRC_DIR}/gui/completion.c"
"${SRC_DIR}/gui/wildmenu.c"
"${SRC_DIR}/gui/popupmenu.c"
"${SRC_DIR}/nvim_event.c"
"${SRC_DIR}/event/option_set.c"
"${SRC_DIR}/event/mode.c"
"${SRC_DIR}/event/cmdline.c"
"${SRC_DIR}/event/popupmenu.c"
"${SRC_DIR}/event/tabline.c"
"${SRC_DIR}/event/eovim.c"
"${SRC_DIR}/event/linegrid.c"
"${SRC_DIR}/event/util.c"
"${SRC_DIR}/nvim_api.c"
"${SRC_DIR}/nvim_attach.c"
"${SRC_DIR}/nvim_helper.c"
"${SRC_DIR}/nvim_request.c"
)
target_include_directories(eovim
SYSTEM PRIVATE
${EFL_INCLUDE_DIRS}
${MSGPACK_INCLUDE_DIRS}
)
target_include_directories(eovim
PRIVATE
"${CMAKE_SOURCE_DIR}/include"
"${BUILD_INCLUDE_DIR}"
)
target_link_libraries(eovim
${EFL_LIBRARIES}
${MSGPACK_LIBRARIES}
)
add_dependencies(eovim themes)
set_compiler_warnings(eovim)
target_compile_definitions(eovim
PRIVATE
PACKAGE_BIN_DIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\"
PACKAGE_LIB_DIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\"
PACKAGE_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}\"
SOURCE_DATA_DIR=\"${CMAKE_SOURCE_DIR}/data\"
BUILD_DATA_DIR=\"${CMAKE_BINARY_DIR}\"
)
install(
TARGETS eovim
RUNTIME DESTINATION bin
)
install(
FILES "${BUILD_THEMES_DIR}/default.edj"
DESTINATION "share/${CMAKE_PROJECT_NAME}/themes"
)
install(FILES
"${CMAKE_SOURCE_DIR}/data/images/neovim.png"
DESTINATION "share/${CMAKE_PROJECT_NAME}/images"
)
install(FILES
"${CMAKE_SOURCE_DIR}/data/vim/runtime.vim"
DESTINATION "share/${CMAKE_PROJECT_NAME}/vim"
)
install(FILES
"${CMAKE_SOURCE_DIR}/data/vim/doc/eovim.txt"
"${CMAKE_SOURCE_DIR}/data/vim/doc/tags"
DESTINATION "share/${CMAKE_PROJECT_NAME}/vim/doc"
)
install(
FILES "${CMAKE_SOURCE_DIR}/data/desktop/eovim.desktop"
DESTINATION "share/applications"
)
install(
FILES
"${CMAKE_SOURCE_DIR}/data/images/eovim.png"
"${CMAKE_SOURCE_DIR}/data/images/eovim.svg"
DESTINATION "share/icons"
)
##############################################################################
# Man page
##############################################################################
add_subdirectory(data/man)