1 find_program(EMACS_EXECUTABLE emacs)
2 if(NOT EMACS_EXECUTABLE)
3 message(SEND_ERROR "Emacs could not be found")
7 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el)
9 set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider)
11 configure_file(sclang-vars.el.in
12 ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el)
14 foreach (el ${scel_sources})
15 configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el})
18 set(all_scel_sources ${scel_sources} sclang-vars.el)
20 foreach (el ${all_scel_sources})
21 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
22 COMMAND ${EMACS_EXECUTABLE} -batch
23 -L ${CMAKE_CURRENT_BINARY_DIR}
25 ${CMAKE_CURRENT_BINARY_DIR}/${el}
26 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}
27 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
28 COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/${el}c")
30 add_custom_target(${el}c ALL
31 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c)
33 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c
34 DESTINATION share/emacs/site-lisp/SuperCollider)