-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
61 lines (44 loc) · 1.78 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
cmake_minimum_required(VERSION 3.16)
project(pplp)
# check if support c++17
# message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")
set(CMAKE_BUILD_TYPE Release) # lib is release version
set(CMAKE_CXX_STANDARD 17)
# CFLAGS=$(pkg-config --cflags libsodium)
# LDFLAGS=$(pkg-config --libs libsodium)
# check results and add flag
# if(COMPILER_SUPPORTS_CXX17)#
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
# message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++17 support!!")
# elseif(COMPILER_SUPPORTS_CXX11)#
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
# else()
# message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
# endif()
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
" ${CMAKE_MODULE_PATH}")
find_package(SEAL 4.1 REQUIRED)
# find_package(sodium REQUIRED)
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lsodium" CACHE STRING "Set C++ Compiler Flags" FORCE)
set(DEP
SEAL::seal
)
# non-interactive demo
add_executable(pplp src/demo.cc)
target_include_directories(pplp PRIVATE ./include)
target_link_libraries(pplp PRIVATE ${DEP})
add_executable(client src/client.cc)
target_include_directories(client PRIVATE ./include)
target_link_libraries(client PRIVATE ${DEP})
add_executable(server src/server.cc)
target_include_directories(server PRIVATE ./include)
target_link_libraries(server PRIVATE ${DEP})
# test
add_executable(tc src/test/test_client.cc)
target_include_directories(tc PRIVATE ./include)
target_link_libraries(tc PRIVATE ${DEP})
add_executable(ts src/test/test_server.cc)
target_include_directories(ts PRIVATE ./include)
target_link_libraries(ts PRIVATE ${DEP})