-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (56 loc) · 1.89 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
cmake_minimum_required(VERSION 3.10)
# project details
project(GMWApp VERSION 1.0)
set(PARTICIPANT_EXEC_NAME participant)
set(LIBRARY_NAME gmw_app_lib)
set(LIBRARY_NAME_SHARED gmw_app_lib_shared)
# packages
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(Boost)
# include(Cryptopp)
include(CTest)
include(Doctest)
include(Documentation)
include(Warnings)
include(Curses)
# Debugging
set(CMAKE_BUILD_TYPE Debug)
# add shared libraries
set(SOURCES_SHARED
src-shared/circuit.cxx
src-shared/messages.cxx
src-shared/logger.cxx
src-shared/util.cxx)
add_library(${LIBRARY_NAME_SHARED} ${SOURCES_SHARED})
target_include_directories(${LIBRARY_NAME_SHARED} PUBLIC ${PROJECT_SOURCE_DIR}/include-shared)
target_link_libraries(${LIBRARY_NAME_SHARED} PUBLIC doctest)
target_link_libraries(${LIBRARY_NAME_SHARED} PRIVATE cryptopp)
# target_link_libraries(${LIBRARY_NAME_SHARED} PRIVATE cryptopp-shared)
target_link_libraries(${LIBRARY_NAME_SHARED} PRIVATE ${Boost_LIBRARIES})
target_link_libraries(${LIBRARY_NAME_SHARED} PRIVATE ${CURSES_LIBRARIES})
# add student libraries
set(SOURCES
src/pkg/peer_link.cxx
src/drivers/cli_driver.cxx
src/drivers/crypto_driver.cxx
src/drivers/network_driver.cxx
src/drivers/ot_driver.cxx
src/drivers/share_driver.cxx)
add_library(${LIBRARY_NAME} ${SOURCES})
target_include_directories(${LIBRARY_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include-shared ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(${LIBRARY_NAME} PRIVATE ${LIBRARY_NAME_SHARED})
# add participant executable
add_executable(${PARTICIPANT_EXEC_NAME} src/cmd/participant.cxx)
target_link_libraries(${PARTICIPANT_EXEC_NAME} PRIVATE ${LIBRARY_NAME})
# properties
set_target_properties(
${LIBRARY_NAME}
${PARTICIPANT_EXEC_NAME}
PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS YES
)
# add tests
add_subdirectory(test)
add_custom_target(check ./test.sh)