scel: install files to site-lisp/SuperCollider
[supercollider.git] / editors / scel / el / CMakeLists.txt
blobcf618c0e0fc09dc42e6c9a3bbb5a726fab22e6df
1 find_program(EMACS_EXECUTABLE emacs)
2 if(NOT EMACS_EXECUTABLE)
3   message(SEND_ERROR "Emacs could not be found")
4 endif()
6 file(GLOB scel_sources
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})
16 endforeach()
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}
24                         -f batch-byte-compile
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)
35 endforeach()