-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 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
53
cmake_minimum_required(VERSION 3.10)
project(libfss)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED on)
add_compile_options(-Wall -Wextra -g -Ofast)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(BUILD_SHARED_LIBS OFF)
set(DCMAKE_EXE_LINKER_FLAGS "-static")
set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(FSS_SRC_FILES
include/fss/seal/uintarith.cpp
include/fss/seal/smallmodulus.cpp
include/fss/expandingprf.cpp
include/fss/fsscontext.cpp
include/fss/fssevaluator.cpp
include/fss/fssgenerator.cpp
)
set(COMMON_SRC_FILES ${FSS_SRC_FILES})
add_executable(fss_example ${COMMON_SRC_FILES} src/fss_example.cpp)
target_link_libraries(fss_example PRIVATE OpenSSL::Crypto)
target_include_directories(fss_example PRIVATE ${INC_DIR})
add_library(fss ${FSS_SRC_FILES})
target_link_libraries(fss PRIVATE OpenSSL::Crypto)
target_include_directories(fss PUBLIC ${INC_DIR})
install(TARGETS fss
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(DIRECTORY ${INC_DIR}/fss
DESTINATION include
FILES_MATCHING PATTERN "*.hpp")