-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
39 lines (31 loc) · 1.21 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
cmake_minimum_required(VERSION 3.1)
project(kv_fdw)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 99)
#init pg enviroment
execute_process(COMMAND pg_config --includedir-server OUTPUT_VARIABLE PG_INCLUDE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND pg_config --sharedir OUTPUT_VARIABLE PG_SHARE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND pg_config --libdir OUTPUT_VARIABLE PG_LIB_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
include_directories(${PG_INCLUDE})
include_directories(${PROJECT_NAME}
./src/
)
add_library(${PROJECT_NAME} SHARED
src/server/kv_storage.cc
src/server/kv_manager.cc
src/server/kv_worker.cc
src/server/kv_storage.cc
src/kv_fdw.c
src/kv_utility.c
src/ipc/kv_posix.cc
src/ipc/kv_message.cc
src/ipc/kv_channel.cc
src/ipc/kv_mq.cc
src/client/kv_client.cc
)
target_link_directories(${PROJECT_NAME} PRIVATE ${PG_LIB_DIR})
target_link_libraries(${PROJECT_NAME} protobuf-c ecpg pthread rocksdb)
# cancel prefix "lib"
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
install(TARGETS ${PROJECT_NAME} DESTINATION ${PG_LIB_DIR})
install(FILES kv_fdw.control kv_fdw--0.0.1.sql DESTINATION ${PG_SHARE_DIR}/extension)