Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 60 lines (51 sloc) 2.618 kB
7a4b879 @brimworks Update the documentation
authored
1 # This cmake file was inspired by:
d7b14fd @brimworks Switch over to using CMake as the build system. This API seems pretty
authored
2 # Copyright (C) 2007-2009 LuaDist.
3 # Submitted by David Manura
4 # Redistribution and use of this file is allowed according to the
5 # terms of the MIT license.
6 # For details see the COPYRIGHT file distributed with LuaDist.
7 # Please note that the package source code is licensed under its own
8 # license.
9
10 PROJECT(lua-ev C)
11 CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
12
13 # Basic configurations
14 SET(INSTALL_CMOD share/lua/cmod CACHE PATH "Directory to install Lua binary modules (configure lua via LUA_CPATH)")
15 # / configs
16
17 # Find libev
18 FIND_LIBRARY (LIBEV_LIBRARY NAMES ev)
19 FIND_PATH (LIBEV_INCLUDE_DIR ev.h
20 PATH_SUFFIXES include/ev include
21 ) # Find header
22 INCLUDE(FindPackageHandleStandardArgs)
23 FIND_PACKAGE_HANDLE_STANDARD_ARGS(libev DEFAULT_MSG LIBEV_LIBRARY LIBEV_INCLUDE_DIR)
24 # / Find libarchive
25
26 # Find lua
27 FIND_PACKAGE(Lua51 REQUIRED)
28 # / Find lua
29
30 # Define how to build ev.so:
8084329 @brimworks Remove pthreads from cmake list, fix typo
authored
31 INCLUDE_DIRECTORIES(${LIBEV_INCLUDE_DIR} ${LUA_INCLUDE_DIR})
d7b14fd @brimworks Switch over to using CMake as the build system. This API seems pretty
authored
32 ADD_LIBRARY(cmod_ev MODULE
33 lua_ev.c
34 )
35 SET_TARGET_PROPERTIES(cmod_ev PROPERTIES PREFIX "")
36 SET_TARGET_PROPERTIES(cmod_ev PROPERTIES OUTPUT_NAME ev)
8084329 @brimworks Remove pthreads from cmake list, fix typo
authored
37 TARGET_LINK_LIBRARIES(cmod_ev ${LUA_LIBRARIES} ${LIBEV_LIBRARY})
d7b14fd @brimworks Switch over to using CMake as the build system. This API seems pretty
authored
38 # / build ev.so
39
40 # Define how to test ev.so:
41 INCLUDE(CTest)
42 FIND_PROGRAM(LUA NAMES lua lua.bat)
43 ADD_TEST(ev_io ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_io.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
44 ADD_TEST(ev_loop ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_loop.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
45 ADD_TEST(ev_timer ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_timer.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
d0d3564 @bdowning Add tests for idle watcher (and priority)
bdowning authored
46 ADD_TEST(ev_idle ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_idle.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
cb3cecf @brimworks Add support for signal watchers.
authored
47 ADD_TEST(ev_signal ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_signal.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
2fa625d @miGlanz Add support for child watchers
miGlanz authored
48 ADD_TEST(ev_child ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_child.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
c8728f4 @miGlanz Add support for stat watchers
miGlanz authored
49 ADD_TEST(ev_stat ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test/test_ev_stat.lua ${CMAKE_CURRENT_SOURCE_DIR}/test/ ${CMAKE_CURRENT_BINARY_DIR}/)
50 SET_TESTS_PROPERTIES(ev_io ev_loop ev_timer ev_signal ev_idle ev_child ev_stat
c209ca2 @brimworks Add support for ev.Loop:backend() used to query which backend is used.
authored
51 PROPERTIES
52 FAIL_REGULAR_EXPRESSION
53 "not ok")
54
d7b14fd @brimworks Switch over to using CMake as the build system. This API seems pretty
authored
55 # / test ev.so
56
57 # Where to install stuff
58 INSTALL (TARGETS cmod_ev DESTINATION ${INSTALL_CMOD})
59 # / Where to install.
Something went wrong with that request. Please try again.