-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
78 lines (55 loc) · 2.09 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
# CMakeLists files in this project can refer to the root source directory of
# the project as ${SOURCE_DIR} and to the root binary directory of
# the project as ${BINARY_DIR}.
cmake_minimum_required(VERSION 2.8)
#note: use correct gcc version /usr/bin/gcc
PROJECT(CERT_CHECK)
# include standard cmake modules
INCLUDE(FindThreads)
#INCLUDE(FindQt4)
# Allow empty ELSE() and ENDIF() constructs
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
# gnu-compiler flags
# Version info
SET(MAJOR_VERSION 0)
SET(MINOR_VERSION 1)
SET(PATCH_VERSION 0)
SET(CMAKE_C_FLAGS "-std=c99 -pedantic")
SET(CMAKE_CXX_FLAGS "-std=c++11 -pedantic")
ADD_DEFINITIONS(
# -finline-functions -O3 -fomit-frame-pointer -momit-leaf-frame-pointer
-fstrict-aliasing
-W -Wall -Wextra -Wno-long-long
-Wno-sign-compare -Wno-unused-parameter -Wno-unused-label -Wno-cast-qual
-Wno-char-subscripts
-Wunused-function -Wunused-value -Wunused-variable
-Wpointer-arith -Wcast-align -Wwrite-strings
#out: -Wconversion
)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: 'Debug' and 'Release'."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "debug")
ADD_DEFINITIONS(-g)
SET(DEBUG_STRING _d)
ENDIF()
LINK_DIRECTORIES(../third_party_libs/openssl-1.1.0
../third_party_libs/Botan-2.2.0 ../third_party_libs/mbedtls-2.4.2/library )
SET(PROJECT_BINARY_DIR build)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
# Directories
SET(INCLUDE_DIR include
../third_party_libs/openssl-1.1.0/include
../third_party_libs/Botan-2.2.0/build/include
../third_party_libs/mbedtls-2.4.2/include )
SET(SRC_DIR src )
# List of source files
FILE(GLOB SRCS ${SRC_DIR}/*.cpp ${SRC_DIR}/*.c )
# include folder with header files
INCLUDE_DIRECTORIES(${INCLUDE_DIR} )
ADD_EXECUTABLE(cert_test ${SRCS})
#TARGET_LINK_LIBRARIES(cert_test crypto)
TARGET_LINK_LIBRARIES(cert_test crypto botan-2 mbedcrypto mbedx509 mbedtls)