scel: add option to install without bytecode compilation

Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2012-03-04 17:37:24 +01:00
parent 67d100d7d7
commit dfb69f398b

View file

@ -3,6 +3,8 @@ if(NOT EMACS_EXECUTABLE)
message(SEND_ERROR "Emacs could not be found") message(SEND_ERROR "Emacs could not be found")
endif() endif()
option(SC_EL_BYTECOMPILE "Build emacs-based IDE." ON)
file(GLOB scel_sources file(GLOB scel_sources
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el) RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el)
@ -17,19 +19,24 @@ endforeach()
set(all_scel_sources ${scel_sources} sclang-vars.el) set(all_scel_sources ${scel_sources} sclang-vars.el)
foreach (el ${all_scel_sources}) if (SC_EL_BYTECOMPILE)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c foreach (el ${all_scel_sources})
COMMAND ${EMACS_EXECUTABLE} -batch add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
-L ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${EMACS_EXECUTABLE} -batch
-f batch-byte-compile -L ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/${el} -f batch-byte-compile
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el} ${CMAKE_CURRENT_BINARY_DIR}/${el}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}
COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/${el}c") WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating byte-compiled Emacs lisp ${CMAKE_CURRENT_BINARY_DIR}/${el}c")
add_custom_target(${el}c ALL add_custom_target(${el}c ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c
DESTINATION share/emacs/site-lisp/SuperCollider) DESTINATION share/emacs/site-lisp/SuperCollider)
endforeach() endforeach()
else()
install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
DESTINATION share/emacs/site-lisp/SuperCollider)
endif()