-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (47 loc) · 1.7 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.7)
project(protoMesh)
# C++ compiler settings
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -Wno-unused-parameter")
# Enable the use of the global offset table
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Include CMake helpers
include(cmake/BuildFlatbuffers.cmake)
# Include unit testing framework and init relevant variables
include_directories(lib/catch/single_include)
include_directories(${CMAKE_SOURCE_DIR}/modules/testing)
set(PROTOMESH_TEST_FILES ${CMAKE_SOURCE_DIR}/modules/testing/test.cpp)
set(PROTOMESH_TEST_DEPS)
# Add micro-ecc sources
include_directories(lib/micro-ecc)
set(ECC_SOURCES
${CMAKE_SOURCE_DIR}/lib/micro-ecc/uECC.h
${CMAKE_SOURCE_DIR}/lib/micro-ecc/uECC.c
${CMAKE_SOURCE_DIR}/lib/micro-ecc/uECC_vli.h
${CMAKE_SOURCE_DIR}/lib/micro-ecc/types.h)
# Add result source
include_directories(lib/result)
set(RESULT_SOURCES
${CMAKE_SOURCE_DIR}/lib/result/result.h)
# Add AES-256 sources
include_directories(lib/AES)
set(AES_SOURCES
${CMAKE_SOURCE_DIR}/lib/AES/aes.h
${CMAKE_SOURCE_DIR}/lib/AES/aes.c)
# Add common classes
include_directories(modules/common)
# Include the schemes
add_subdirectory(schemes)
# Include project modules
set(PROTOMESH_MODULES cryptography communication interaction integration)
foreach(MODULE ${PROTOMESH_MODULES})
add_subdirectory(modules/${MODULE})
include_directories(modules/${MODULE})
endforeach()
# Define targets
## Unit testing target
add_executable(unit_test ${PROTOMESH_TEST_FILES})
target_compile_definitions(unit_test PRIVATE UNIT_TESTING=1)
if (PROTOMESH_TEST_DEPS)
add_dependencies(unit_test ${PROTOMESH_TEST_DEPS})
endif()