ignore .dir-locals.el in cmake build

This commit is contained in:
nik gaffney 2022-08-18 13:30:23 +02:00
parent 5a5ff2b2b6
commit e97fd18d31
Signed by: nik
GPG key ID: 989F5E6EDB478160

View file

@ -2,49 +2,57 @@ option(SC_EL_BYTECOMPILE "Build emacs-based IDE." ON)
mark_as_advanced(SC_EL_BYTECOMPILE) mark_as_advanced(SC_EL_BYTECOMPILE)
file(GLOB scel_sources file(GLOB scel_sources
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el) RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el)
list(REMOVE_ITEM scel_sources ".dir-locals.el")
file(GLOB_RECURSE local-load-path file(GLOB_RECURSE local-load-path
LIST_DIRECTORIES true LIST_DIRECTORIES true
"~/.emacs.d/site-lisp/*" "~/.emacs.d/site-lisp/*"
"~/.emacs.d/elpa/*") "~/.emacs.d/elpa/*")
set(all_scel_sources ${scel_sources} sclang-vars.el) set(all_scel_sources ${scel_sources} sclang-vars.el)
set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider) 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)
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() endforeach()
set(all_scel_sources ${scel_sources} sclang-vars.el) set(all_scel_sources ${scel_sources} sclang-vars.el)
install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el install (FILES ${scel_sources} ${CMAKE_CURRENT_BINARY_DIR}/sclang-vars.el
DESTINATION share/emacs/site-lisp/SuperCollider) DESTINATION share/emacs/site-lisp/SuperCollider)
if (SC_EL_BYTECOMPILE) if (SC_EL_BYTECOMPILE)
find_program(EMACS_EXECUTABLE emacs) find_program(EMACS_EXECUTABLE emacs)
if(NOT EMACS_EXECUTABLE) if(EMACS_EXECUTABLE-NOTFOUND)
message(SEND_ERROR "Emacs could not be found.\n (If emacs interface is not required, then set SC_EL=no)") message(SEND_ERROR "Emacs could not be found.\n (If emacs interface is not required, then set SC_EL=no)")
endif() endif()
foreach (el ${all_scel_sources}) find_program(W3M_EXECUTABLE w3m)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c if(W3M_EXECUTABLE-NOTFOUND)
COMMAND ${EMACS_EXECUTABLE} -batch message(SEND_ERROR "Install w3m to build the help viewer.")
-L ${CMAKE_CURRENT_BINARY_DIR} endif()
-L ${local-load-path}
-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")
add_custom_target(compile_${el}c ALL foreach (el ${all_scel_sources})
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c
COMMAND ${EMACS_EXECUTABLE} -batch
-L ${CMAKE_CURRENT_BINARY_DIR}
-L ${local-load-path}
-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")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c add_custom_target(compile_${el}c ALL
DESTINATION share/emacs/site-lisp/SuperCollider) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c)
endforeach()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c
DESTINATION share/emacs/site-lisp/SuperCollider)
endforeach()
endif() endif()