From 3c21a65e4cd33357c46e111811f3e2177f3ec113 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Tue, 10 Aug 2010 21:40:54 +0000 Subject: [PATCH] basic cmake-based build system: this patch implements a cmake-based build system for supercollider. it currently builds: - sclang and scsynth on linux - plugins on linux and osx - scel Signed-off-by: Tim Blechmann git-svn-id: https://supercollider.svn.sourceforge.net/svnroot/supercollider/trunk@10240 a380766d-ff14-0410-b294-a243070f3f08 --- CMakeLists.txt | 2 ++ el/CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ sc/CMakeLists.txt | 6 ++++++ 3 files changed, 50 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 el/CMakeLists.txt create mode 100644 sc/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8bfc543 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(el) +add_subdirectory(sc) \ No newline at end of file diff --git a/el/CMakeLists.txt b/el/CMakeLists.txt new file mode 100644 index 0000000..50be63d --- /dev/null +++ b/el/CMakeLists.txt @@ -0,0 +1,42 @@ +find_program(EMACS_EXECUTABLE emacs) +if(NOT EMACS_EXECUTABLE) + message(SEND_ERROR "Emacs could not be found") +endif() + +file(GLOB scel_sources + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.el) + +set(PKG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/SuperCollider) + +configure_file(sclang-vars.el.in + ${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}) + configure_file(${el} ${CMAKE_CURRENT_BINARY_DIR}/${el}) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${el}c + COMMAND ${EMACS_EXECUTABLE} -batch -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(${el}c ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${el}c) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${el}c + DESTINATION share/emacs/site-lisp) +endforeach() diff --git a/sc/CMakeLists.txt b/sc/CMakeLists.txt new file mode 100644 index 0000000..7852104 --- /dev/null +++ b/sc/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB scel_sources + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.sc) + + +install(FILES ${scel_sources} + DESTINATION share/SuperCollider/Extensions/scide_scel)