-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (38 loc) · 1.45 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
cmake_minimum_required(VERSION 3.10)
project(e_vote)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(PYTHON_EXTENSIONS "Build e-vote python extensions" ON)
include_directories("${CMAKE_SOURCE_DIR}/.")
add_library(e_vote
blockchain/blockchain.cpp
blockchain/blockchain_dht.cpp
blockchain/litechain.cpp
blockchain/litechain_dht.cpp
blockchain/merkle.cpp
network/kdht.cpp
security/ecc.cpp
security/identity.cpp
utils/utils.cpp
)
add_library(identity
security/ecc.cpp
security/identity.cpp)
target_link_libraries(e_vote -lcryptopp -lopendht -lreadline -lpthread)
if (PYTHON_EXTENSIONS)
find_package(PythonLibs 3.7 REQUIRED)
find_package(Boost 1.70.0 REQUIRED COMPONENTS python)
include_directories(${Boost_INCLUDE_DIR} "/usr/include/python3.7m")
add_library(evotepy SHARED evote-py.cpp)
target_link_libraries(identity -lcryptopp)
target_link_libraries(evotepy -lboost_python37 identity e_vote)
set_target_properties(evotepy PROPERTIES PREFIX "")
install(TARGETS evotepy DESTINATION "${CMAKE_SOURCE_DIR}/.")
endif ()
unset(PYTHON_EXTENSIONS CACHE)
ADD_EXECUTABLE(peer peer.cpp)
target_link_libraries(peer e_vote)
ADD_EXECUTABLE(enctest tests/enctest.cpp)
target_link_libraries(enctest identity -lcryptopp)
install(TARGETS peer DESTINATION "${CMAKE_SOURCE_DIR}/.")
install(TARGETS enctest DESTINATION "${CMAKE_SOURCE_DIR}/.")