diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-17 13:07:17 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-17 13:07:17 +0200 |
commit | bdaae5b6704e29919ec7f284b9e3abe54f96f2f8 (patch) | |
tree | 75b3860a2cea86ec7e55d978730b13e41c8015da /cmake/erlang | |
parent | ca7a0bfa5dd63fc45df0a46800a76d7048e70f2b (diff) | |
download | ephraim-bdaae5b6704e29919ec7f284b9e3abe54f96f2f8.tar ephraim-bdaae5b6704e29919ec7f284b9e3abe54f96f2f8.zip |
Added CMake build system
Diffstat (limited to 'cmake/erlang')
-rw-r--r-- | cmake/erlang/ErlangTarget.cmake | 26 | ||||
-rw-r--r-- | cmake/erlang/FindErlang.cmake | 6 |
2 files changed, 32 insertions, 0 deletions
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) diff --git a/cmake/erlang/FindErlang.cmake b/cmake/erlang/FindErlang.cmake new file mode 100644 index 0000000..e7cb60f --- /dev/null +++ b/cmake/erlang/FindErlang.cmake @@ -0,0 +1,6 @@ +find_program(ERLC_EXECUTABLE NAMES erlc) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Erlang DEFAULT_MSG ERLC_EXECUTABLE) +mark_as_advanced(ERLC_EXECUTABLE) + |