-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (62 loc) · 2.71 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
cmake_minimum_required (VERSION 3.5.1)
### To use gcc/g++ on a Macintosh, you must set the Compilers
### here, not inside the project
##if(APPLE)
## set(CMAKE_C_COMPILER "/usr/local/bin/gcc-7")
## set(CMAKE_CXX_COMPILER "/usr/local/bin/g++-7")
##endif()
### TODO: for now, we use CLang for Mac
project(OPENFHE-NETWORK-EXAMPLES CXX)
message( STATUS "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}" )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option( BUILD_STATIC "Set to ON to include static versions of the library" OFF)
### pass a value for OPENFHE_INSTALL_DIR if there is an issue locatig the correct package
### EXAMPLE:
### cmake -DOPENFHE_INSTALL_DIR=[PATH TO OpennFHE] ..
find_package(OpenFHE CONFIG HINTS ${OPENFHE_INSTALL_DIR} REQUIRED)
if (OpenFHE_FOUND)
message(STATUS "FOUND PACKAGE OpenFHE")
message(STATUS "OpenFHE Version: ${BASE_OPENFHE_VERSION}")
message(STATUS "OpenFHE installed as shared libraries: ${OpenFHE_SHARED}")
message(STATUS "OpenFHE include files location: ${OpenFHE_INCLUDE}")
message(STATUS "OpenFHE lib files location: ${OpenFHE_LIBDIR}")
message(STATUS "OpenFHE Native Backend size: ${OpenFHE_NATIVE_SIZE}")
else()
message(FATAL_ERROR "PACKAGE OpenFHE NOT FOUND")
endif ()
set(CMAKE_CXX_FLAGS ${OpenFHE_CXX_FLAGS})
include_directories( ${OPENMP_INCLUDES} )
include_directories( ${OpenFHE_INCLUDE} )
include_directories( ${OpenFHE_INCLUDE}/third-party/include )
include_directories( ${OpenFHE_INCLUDE}/core )
include_directories( ${OpenFHE_INCLUDE}/core/include )
include_directories( ${OpenFHE_INCLUDE}/pke )
include_directories( ${OpenFHE_INCLUDE}/binfhe )
### add directories for other OpenFHE modules as needed for your project
link_directories( ${OpenFHE_LIBDIR} )
link_directories( ${OPENMP_LIBRARIES} )
if(BUILD_STATIC)
set( CMAKE_EXE_LINKER_FLAGS "${OpenFHE_EXE_LINKER_FLAGS} -static")
link_libraries( ${OpenFHE_STATIC_LIBRARIES} )
else()
set( CMAKE_EXE_LINKER_FLAGS ${OpenFHE_EXE_LINKER_FLAGS} )
link_libraries( ${OpenFHE_SHARED_LIBRARIES} )
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
### ADD YOUR EXECUTABLE(s) HERE
add_subDirectory(src/pre_grpc_demo)
add_subDirectory(src/peer_to_peer_framework)
add_subDirectory(src/threshold_fhe_aborts)
add_subDirectory(src/threshnet_aborts_grpc_demo)
add_subDirectory(src/threshnet_aborts_p2p_demo)
add_subDirectory(src/threshnet_adjacent_measure_demo)
add_subDirectory(src/network_measure_examples)
option(BUILD_UNITTESTS "Set OFF to prevent building the unit tests" OFF)
message(STATUS "BUILD_TESTS: ${BUILD_UNITTESTS}")
### Our tests
if (BUILD_UNITTESTS)
add_subdirectory(tests/two_party)
add_subdirectory(tests/n_party)
endif()