-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
59 lines (45 loc) · 1.56 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(membership C)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
# Find Tarantool and Lua dependecies
set(TARANTOOL_FIND_REQUIRED ON)
find_package(Tarantool)
include_directories(${TARANTOOL_INCLUDE_DIRS})
file(GLOB_RECURSE LUA_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/membership.lua"
"${CMAKE_CURRENT_SOURCE_DIR}/membership/*.lua"
)
## API doc ####################################################################
###############################################################################
if(DEFINED ENV{CMAKE_LDOC_FIND_REQUIRED})
set(LDOC_FIND_REQUIRED "$ENV{CMAKE_LDOC_FIND_REQUIRED}")
endif()
find_package(Ldoc)
set(DOC_OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/doc/index.html)
add_custom_command(
OUTPUT DOC_OUTPUT
COMMAND ${LDOC} --all .
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${LUA_FILES}
COMMENT "Building API documentation"
VERBATIM
)
if(LDOC_FOUND)
add_custom_target(doc ALL
DEPENDS DOC_OUTPUT)
else()
add_custom_target(doc
DEPENDS DOC_OUTPUT)
endif()
## Testing ####################################################################
###############################################################################
enable_testing()
add_test(
NAME test_integration
COMMAND pytest -v
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
## Install ####################################################################
###############################################################################
install(CODE "")