cmake build system: copy all *el files to build directory

this ensures a correct elisp bytecode compilation

Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2010-11-16 16:04:49 +01:00
parent 99ff5e5747
commit 0985d6a202

View file

@ -11,24 +11,16 @@ set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider)
configure_file(sclang-vars.el.in configure_file(sclang-vars.el.in
${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el) ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.elc
COMMAND ${EMACS_EXECUTABLE} -batch -f batch-byte-compile
${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.elc")
add_custom_target(sclang-vars.elc ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.elc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.elc
DESTINATION share/emacs/site-lisp)
foreach (el ${scel_sources}) foreach (el ${scel_sources})
configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el}) configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el})
endforeach()
set(all_scel_sources ${scel_sources} sclang-vars.el)
foreach (el ${all_scel_sources})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
COMMAND ${EMACS_EXECUTABLE} -batch COMMAND ${EMACS_EXECUTABLE} -batch
--eval \"(add-to-list 'load-path (expand-file-name \\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"))\" --eval \"(add-to-list 'load-path (expand-file-name \\\"${CMAKE_CURRENT_BINARY_DIR}\\\")) \"
-f batch-byte-compile -f batch-byte-compile
${CMAKE_CURRENT_BINARY_DIR}/${el} ${CMAKE_CURRENT_BINARY_DIR}/${el}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}