-
Notifications
You must be signed in to change notification settings - Fork 35
/
CMakeLists.txt
89 lines (64 loc) · 2.76 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
83
84
85
86
87
cmake_minimum_required (VERSION 2.8)
project("libPSI")
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib)
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib)
#############################################
# Flag and #defines #
#############################################
add_definitions(-DSOLUTION_DIR=\"${CMAKE_SOURCE_DIR}\")
set(CMAKE_C_FLAGS "-ffunction-sections -Wall -maes -msse2 -msse4.1 -mpclmul -Wfatal-errors -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++14")
# Set a default build type for single-configuration
# CMake generators if no build type is set.
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
endif()
if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
message(WARNING "\nConfiguration NOT set to Release. Please call cmake with CMAKE_BUILD_TYPE=Release")
endif()
# Select flags.
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
#############################################
# Library/includes locations #
#############################################
# default location for libOTe
set(libOTe_Dirs "${CMAKE_SOURCE_DIR}/libOTe/")
include_directories("${libOTe_Dirs}/libOTe/")
link_directories("${libOTe_Dirs}/lib/")
# default location for miracl
set(Miracl_Dirs "${CMAKE_SOURCE_DIR}/thirdparty/linux/miracl/")
include_directories("${Miracl_Dirs}")
link_directories("${Miracl_Dirs}/miracl/source/")
# default location for NTL
set(NTL_Dirs "${CMAKE_SOURCE_DIR}/thirdparty/linux/ntl/")
include_directories("${NTL_Dirs}/include/")
link_directories("${NTL_Dirs}/src/")
# default location for Boost
set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/thirdparty/linux/boost/")
#############################################
# Build cryptoTools #
#############################################
add_subdirectory(cryptoTools)
include_directories(cryptoTools)
#############################################
# Build libOTe #
#############################################
add_subdirectory(libOTe)
include_directories(libOTe)
#############################################
# Build libOPRF #
#############################################
add_subdirectory(libOPRF)
include_directories(libOPRF)
#############################################
# Build libPSI Tests #
#############################################
#add_subdirectory(libPSI_Tests)
#include_directories(libPSI_Tests)
#############################################
# Build Frontend #
#############################################
add_subdirectory(frontend)