-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
58 lines (44 loc) · 1.41 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
cmake_minimum_required(VERSION 3.00)
project(pydolphindbimpl)
if(WIN32)
add_definitions(-DWINDOWS)
elseif(UNIX)
add_definitions(-DLINUX -D_GLIBCXX_USE_CXX11_ABI=0)
endif()
add_definitions(-DLOGGING_LEVEL_1)
set(CMAKE_CXX_STANDARD 11)
set(PYBIND11_CPP_STANDARD -std=c++11)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include_directories(${PROJECT_SOURCE_DIR}/api-cplusplus/include
${PROJECT_SOURCE_DIR}/src)
if(WIN32)
link_directories(${PROJECT_SOURCE_DIR}/api-cplusplus/bin/mingw_x64
${OPENSSL_LIB_PATH})
elseif(UNIX)
link_directories(${PROJECT_SOURCE_DIR}/api-cplusplus/bin/linux_x64
${OPENSSL_LIB_PATH})
endif()
link_libraries(DolphinDBAPI
ssl)
add_subdirectory(pybind11)
aux_source_directory(${PROJECT_SOURCE_DIR}/src PYDOLPHINDB_SOURCE)
pybind11_add_module(pydolphindbimpl
${PYDOLPHINDB_SOURCE})
target_link_libraries(pydolphindbimpl
PUBLIC
DolphinDBAPI
ssl
uuid
crypto
pthread)
install(TARGETS pydolphindbimpl
DESTINATION ${PROJECT_SOURCE_DIR}/pydolphindb)
if(WIN32)
install(FILES ${PROJECT_SOURCE_DIR}/api-cplusplus/bin/mingw_x64/libDolphinDBAPI.dll
DESTINATION ${PROJECT_SOURCE_DIR}/pydolphindb)
elseif(UNIX)
install(FILES ${PROJECT_SOURCE_DIR}/api-cplusplus/bin/linux_x64/libDolphinDBAPI.so
DESTINATION ${PROJECT_SOURCE_DIR}/pydolphindb)
endif()