-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
82 lines (65 loc) · 2.3 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
79
80
81
82
cmake_minimum_required( VERSION 3.7 )
project( orderbook CXX )
set( CMAKE_VERBOSE_MAKEFILE OFF )
add_compile_options( -Wall )
add_compile_options( -pedantic )
add_compile_options( -fPIC )
add_compile_options( -std=c++17 )
find_package( PythonLibs "3.5" REQUIRED )
find_package( PythonInterp "3.5" REQUIRED )
find_package( Boost COMPONENTS python3 REQUIRED )
set( PythonPkgPathCmd "import distutils.sysconfig as cfg; print(cfg.get_python_lib())" )
execute_process (
COMMAND ${PYTHON_EXECUTABLE} -c "${PythonPkgPathCmd}"
OUTPUT_VARIABLE PythonPkgPath OUTPUT_STRIP_TRAILING_WHITESPACE
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${PYTHON_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
add_library( orderbook SHARED
src/OrderBookMain.cpp
src/OrderBook.cpp
src/Order.cpp
src/NewOrder.cpp
src/CancelOrder.cpp
src/CancelAll.cpp
src/Trade.cpp
src/Response.cpp
)
set_target_properties( orderbook PROPERTIES PREFIX "" )
target_link_libraries ( orderbook ${Boost_LIBRARIES} )
install(
TARGETS orderbook
DESTINATION ${PythonPkgPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
)
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/README.md
DESTINATION /usr/share/orderbook
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test
DESTINATION /usr/share/orderbook
FILES_MATCHING PATTERN "*.py"
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin
DESTINATION /usr
FILES_MATCHING PATTERN "*.py"
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
set( CPACK_GENERATOR "DEB" )
set( CPACK_PACKAGE_VERSION_MAJOR "1" )
set( CPACK_PACKAGE_VERSION_MINOR "0" )
set( CPACK_PACKAGE_VERSION_PATCH "0" )
set( CPACK_DEBIAN_PACKAGE_DESCRIPTION "Orderbook engine" )
set( CPACK_DEBIAN_PACKAGE_MAINTAINER "Pavel Schön <[email protected]>" )
set( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/pavelschon/Orderbook.git")
set( CPACK_DEBIAN_PACKAGE_DEPENDS "python3 (>= 3.5), python3-twisted (>= 16.6), libboost-python${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}" )
set( CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS "g++, python3-dev (>= 3.5), libboost-all-dev" )
include(CPack)