-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (60 loc) · 1.43 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 2.8)
project(tpw)
include(TestCXXAcceptsFlag)
check_cxx_accepts_flag("--std=c++11" CPP11_SUPPORTED_FLAG)
if (NOT CPP11_SUPPORTED_FLAG)
message(FATAL_ERROR "C++11 is required")
endif()
add_definitions(-std=c++11)
set(TARANTOOL_C_INCLUDE_DIR
"/somewhere/tarantool-c/src/include"
CACHE STRING "directory with tp.h"
)
set(TARANTOOL_C_THIRD_PARTY
"/somewhere/tarantool-c/src/third_party"
CACHE STRING "directory with third party stuff"
)
set(TARANTOOL_C_LIBRARIES
"/somewhere/tarantool-c/"
CACHE STRING "directory with libtb binary"
)
set(MSGPUCK_INCLUDE_DIR
"/somewhere/tarantool-c/src/third_party/msgpuck"
CACHE STRING "directory with msgpuck.h"
)
include_directories(
${TARANTOOL_C_INCLUDE_DIR}
${TARANTOOL_C_THIRD_PARTY}
${MSGPUCK_INCLUDE_DIR}
)
link_directories(
${TARANTOOL_C_LIBRARIES}
)
add_library(tpw
tpw.cpp
)
target_link_libraries(tpw LINK_PRIVATE
tarantool
)
add_executable(tpwtest
test.cpp
)
target_link_libraries(tpwtest
tarantoolnet
tpw
)
add_executable(tpwmaptest
maptest.cpp
)
target_link_libraries(tpwmaptest
tarantoolnet
tpw
)
if (NOT LIB_INSTALL_DIR)
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif (NOT LIB_INSTALL_DIR)
if(NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install (TARGETS tpw DESTINATION ${LIB_INSTALL_DIR})
install (FILES tpw.hpp tpw.ipp tp_ext.h DESTINATION ${INCLUDE_INSTALL_DIR})