-
Notifications
You must be signed in to change notification settings - Fork 75
/
CMakeLists.txt
59 lines (51 loc) · 1.61 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
cmake_minimum_required(VERSION 3.6)
project(ledger-mode)
set(EMACS_LISP_SOURCES
ledger-check.el
ledger-commodities.el
ledger-complete.el
ledger-context.el
ledger-exec.el
ledger-fontify.el
ledger-fonts.el
ledger-init.el
ledger-mode.el
ledger-navigate.el
ledger-occur.el
ledger-post.el
ledger-reconcile.el
ledger-regex.el
ledger-report.el
ledger-schedule.el
ledger-sort.el
ledger-state.el
ledger-test.el
ledger-texi.el
ledger-xact.el)
# find emacs and complain if not found
find_program(EMACS_EXECUTABLE emacs)
macro(add_emacs_lisp_target el)
configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el})
# add rule (i.e. command) how to generate the byte-compiled file
add_custom_command(
OUTPUT ${el}c
COMMAND ${EMACS_EXECUTABLE}
-L ${CMAKE_CURRENT_BINARY_DIR}
-l ${CMAKE_CURRENT_BINARY_DIR}/ledger-regex.el
-batch -f batch-byte-compile
${CMAKE_CURRENT_BINARY_DIR}/${el}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/${el}c")
endmacro(add_emacs_lisp_target el)
if (EMACS_EXECUTABLE)
foreach(el ${EMACS_LISP_SOURCES})
add_emacs_lisp_target(${el})
list(APPEND EMACS_LISP_BINARIES ${CMAKE_CURRENT_BINARY_DIR}/${el}c)
endforeach()
add_custom_target(emacs_lisp_byte_compile ALL DEPENDS ${EMACS_LISP_BINARIES})
# install the byte-compiled emacs-lisp sources
install(FILES ${EMACS_LISP_SOURCES} ${EMACS_LISP_BINARIES}
DESTINATION share/emacs/site-lisp/ledger-mode)
endif()
### CMakeLists.txt ends here