From bdaae5b6704e29919ec7f284b9e3abe54f96f2f8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 17 Jun 2010 13:07:17 +0200 Subject: Added CMake build system --- cmake/erlang/ErlangTarget.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmake/erlang/ErlangTarget.cmake (limited to 'cmake/erlang/ErlangTarget.cmake') diff --git a/cmake/erlang/ErlangTarget.cmake b/cmake/erlang/ErlangTarget.cmake new file mode 100644 index 0000000..cfcc431 --- /dev/null +++ b/cmake/erlang/ErlangTarget.cmake @@ -0,0 +1,26 @@ +macro(erl_target name) + set(in_files "") + set(out_files "") + + foreach(src ${ARGN}) + list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") + string(REPLACE ".erl" ".beam" src ${src}) + set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${src}") + list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${src}") + endforeach(src ${ARGN}) + + add_custom_command( + OUTPUT + ${out_files} + COMMAND + ${ERLC_EXECUTABLE} + ARGS + "-o" ${CMAKE_CURRENT_BINARY_DIR} + ${in_files} + DEPENDS + ${in_files} + ) + add_custom_target( + ${name} ALL DEPENDS ${out_files} + ) +endmacro(erl_target) -- cgit v1.2.3