2012-03-04 16:37:24 +00:00
|
|
|
option(SC_EL_BYTECOMPILE "Build emacs-based IDE." ON)
|
2012-03-07 22:32:41 +00:00
|
|
|
mark_as_advanced(SC_EL_BYTECOMPILE)
|
2012-03-04 16:37:24 +00:00
|
|
|
|
2010-08-10 21:40:54 +00:00
|
|
|
file(GLOB scel_sources
|
|
|
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el)
|
|
|
|
|
2022-08-17 07:19:50 +00:00
|
|
|
file(GLOB_RECURSE local-load-path
|
|
|
|
LIST_DIRECTORIES true
|
|
|
|
"~/.emacs.d/site-lisp/*"
|
|
|
|
"~/.emacs.d/elpa/*")
|
|
|
|
|
|
|
|
set(all_scel_sources ${scel_sources} sclang-vars.el)
|
|
|
|
|
2010-08-10 21:40:54 +00:00
|
|
|
set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider)
|
|
|
|
|
|
|
|
configure_file(sclang-vars.el.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el)
|
|
|
|
|
|
|
|
foreach (el ${scel_sources})
|
|
|
|
configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el})
|
2010-11-16 15:04:49 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(all_scel_sources ${scel_sources} sclang-vars.el)
|
|
|
|
|
2018-03-30 12:13:21 +00:00
|
|
|
install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
|
|
|
|
DESTINATION share/emacs/site-lisp/SuperCollider)
|
2012-03-04 16:37:24 +00:00
|
|
|
if (SC_EL_BYTECOMPILE)
|
2012-03-07 22:29:09 +00:00
|
|
|
find_program(EMACS_EXECUTABLE emacs)
|
|
|
|
if(NOT EMACS_EXECUTABLE)
|
2012-09-07 11:11:25 +00:00
|
|
|
message(SEND_ERROR "Emacs could not be found.\n (If emacs interface is not required, then set SC_EL=no)")
|
2012-03-07 22:29:09 +00:00
|
|
|
endif()
|
|
|
|
|
2012-03-04 16:37:24 +00:00
|
|
|
foreach (el ${all_scel_sources})
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
|
|
|
|
COMMAND ${EMACS_EXECUTABLE} -batch
|
|
|
|
-L ${CMAKE_CURRENT_BINARY_DIR}
|
2022-08-17 07:19:50 +00:00
|
|
|
-L ${local-load-path}
|
2012-03-04 16:37:24 +00:00
|
|
|
-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")
|
|
|
|
|
2020-04-10 19:17:56 +00:00
|
|
|
add_custom_target(compile_${el}c ALL
|
2012-03-04 16:37:24 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c
|
|
|
|
DESTINATION share/emacs/site-lisp/SuperCollider)
|
|
|
|
endforeach()
|
|
|
|
endif()
|