-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
73 lines (61 loc) · 1.68 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
project(uv-msgpack)
cmake_minimum_required(VERSION 2.8)
option(UVMSGPACK_BUILD_SAMPLES "Build uv-msgpack samples" OFF)
# FIXME: Why??
configure_file(msgpack-c/sysdep.h
${CMAKE_CURRENT_BINARY_DIR}/msgpack/sysdep.h
COPYONLY)
configure_file(msgpack-c/unpack_define.h
${CMAKE_CURRENT_BINARY_DIR}/msgpack/unpack_define.h
COPYONLY)
configure_file(msgpack-c/unpack_template.h
${CMAKE_CURRENT_BINARY_DIR}/msgpack/unpack_template.h
COPYONLY)
configure_file(msgpack-c/pack_define.h
${CMAKE_CURRENT_BINARY_DIR}/msgpack/pack_define.h
COPYONLY)
configure_file(msgpack-c/pack_template.h
${CMAKE_CURRENT_BINARY_DIR}/msgpack/pack_template.h
COPYONLY)
# FIXME: Make sure msgpack will look into them
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
# NB: We use these subdirectories later...
add_subdirectory(uv uv EXCLUDE_FROM_ALL)
add_subdirectory(msgpack-c msgpack EXCLUDE_FROM_ALL)
set(DEP_LIBS msgpack uv)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/msgpack
msgpack-c
msgpack-c/src
include
uv/include
)
if(WIN32)
list(APPEND DEP_LIBS ws2_32 psapi iphlpapi)
else(UNIX)
list(APPEND DEP_LIBS pthread m)
endif()
if(APPLE)
find_library(core_services CoreServices)
list(APPEND DEP_LIBS ${core_services})
endif()
# lib
set(srcs
src/chime.c
src/client.c
src/writer.c
src/reader.c)
add_library(uvmsgpack
STATIC
${srcs})
macro(add_sample nam)
add_executable(${nam} ${ARGN})
target_link_libraries(${nam} uvmsgpack ${DEP_LIBS})
endmacro(add_sample)
if(UVMSGPACK_BUILD_SAMPLES)
add_sample(addserv samples/addserv.c)
add_sample(addclient samples/addclient.c)
endif()