-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (70 loc) · 2.58 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# cmake setup
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# general setup
set(NUMBER_OF_GROUPS 66)
set(GROUP_NUMBER "41")
project(its2016 C CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build." FORCE)
endif()
# options
option(VALGRIND_ARGS "additional arguments to valgrind" "")
# doygen setup
SET(DOXYGEN_CONFIG_IN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/template.doxy.in")
set(DEFAULT_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc")
include(testing)
include(doxygenSupport)
include(CheckCPUID)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(FindCheck)
# set required C and C++ standard version
if(CMAKE_MAJOR_VERSION EQUAL 2 OR (CMAKE_MAJOR_VERSION EQUAL 3 AND CMAKE_MINOR_VERSION EQUAL 0))
# let's hope for the best
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
# check cpuid
CheckCPUID()
# check compiler flags
foreach(flag IN ITEMS "-Wall" "-fdiagnostics-color=auto")
check_c_compiler_flag(${flag} CC_SUPPORTS_${flag})
check_cxx_compiler_flag(${flag} CXX_SUPPORTS_${flag})
if(CC_SUPPORTS_${flag})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
endif()
if(CXX_SUPPORTS_${flag})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endif()
endforeach(flag)
find_package(Check REQUIRED)
# add aubdirectories
add_subdirectory(tls)
add_subdirectory(ecclib)
add_subdirectory(blockchain)
message(STATUS "---------------------------------------------------------------------")
message(STATUS "Configuration for ${CMAKE_PROJECT_NAME} done.")
message(STATUS "BUILD TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS "CC: ${CMAKE_C_COMPILER}")
message(STATUS "CXX: ${CMAKE_CXX_COMPILER}")
message(STATUS "CPU supports:")
if(HAVE_CPU_RDTSCP)
message(STATUS " RDTSCP")
endif()
message(STATUS "")
message(STATUS "Available targets:")
message(STATUS " all...............Builds all programs.")
message(STATUS " suite.............Builds the test program.")
message(STATUS " check.............Runs the test program.")
message(STATUS " doxygen...........Build doxygen documentation.")
message(STATUS " tls...............Run TLS attack programs.")
message(STATUS " blockchain_attack.Run blockchain attack programs.")
message(STATUS "---------------------------------------------------------------------")