wangzhengquan
2020-12-30 5eced9fa401e05226309ec9682df4310b18683c3
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
79
80
81
82
83
84
85
 
 
# should we use our own math functions
option(SUPPORT_RDMA "If support rdma" ON)
 
# configure a header file to pass some of the CMake settings
# to the source code
configure_file(BusConfig.h.in BusConfig.h)
 
add_library(shm_queue 
        logger_factory.cpp
        socket/bus_server_socket.cpp
        socket/bus_server_socket_wrapper.cpp
        socket/shm_stream_mod_socket.cpp
        socket/shm_socket.cpp
        socket/net_conn_pool.cpp
        socket/shm_mod_socket.cpp
        socket/net_mod_server_socket_wrapper.cpp
        socket/net_mod_socket_wrapper.cpp
        socket/net_mod_socket.cpp
        socket/net_mod_socket_io.cpp
        socket/net_mod_server_socket.cpp
        bus_error.cpp
        queue/shm_queue_wrapper.cpp
        shm/shm_mm_wrapper.cpp
        shm/mm.cpp
        shm/hashtable.cpp
 
    )
 
target_include_directories(shm_queue PUBLIC
                           "${PROJECT_BINARY_DIR}"
                           "${PROJECT_SOURCE_DIR}/include/usgcommon"
                           )
 
target_include_directories(shm_queue PUBLIC
                           ${CMAKE_CURRENT_SOURCE_DIR}
                           ${CMAKE_CURRENT_SOURCE_DIR}/shm
                           ${CMAKE_CURRENT_SOURCE_DIR}/queue
                           ${CMAKE_CURRENT_SOURCE_DIR}/socket
                           )
 
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
target_include_directories(shm_queue INTERFACE 
                                                     ${CMAKE_CURRENT_SOURCE_DIR}
                                           ${CMAKE_CURRENT_SOURCE_DIR}/shm
                                           ${CMAKE_CURRENT_SOURCE_DIR}/queue
                                           ${CMAKE_CURRENT_SOURCE_DIR}/socket
                                          )
 
# install rules
install(TARGETS shm_queue DESTINATION lib)
install(FILES 
    socket/socket_def.h
    socket/net_conn_pool.h
    socket/bus_server_socket.h
    socket/shm_socket.h
    socket/net_mod_socket.h
    socket/shm_stream_mod_socket.h
    socket/net_mod_server_socket_wrapper.h
    socket/net_mod_socket_io.h
    socket/net_mod_server_socket.h
    socket/shm_mod_socket.h
    socket/net_mod_socket_wrapper.h
    socket/bus_server_socket_wrapper.h
    key_def.h
    bus_error.h
    logger_factory.h
    queue/linked_lock_free_queue.h
    queue/array_lock_free_queue2.h
    queue/array_lock_free_queue.h
    queue/shm_queue.h
    queue/shm_queue_wrapper.h
    queue/lock_free_queue.h
    shm/hashtable.h
    shm/mem_pool.h
    shm/mm.h
    shm/shm_allocator.h
    shm/shm_mm_wraper.h
  DESTINATION include)
 
install(FILES "${PROJECT_BINARY_DIR}/src/BusConfig.h"
    DESTINATION include
)