forked from ph4r05/Whitebox-crypto-AES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (50 loc) · 1.74 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
cmake_minimum_required(VERSION 2.8)
project(Whitebox_crypto_AES)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
option(NTL_NO_DEFAULT_PATH "Using just given paths when searching for NTL" OFF)
set(SOURCE_FILES
base.h
base.cpp
BGEAttack.cpp
BGEAttack.h
BGEAttack_test.cpp
GenericAES.cpp
GenericAES.h
LinearAffineEq.cpp
LinearAffineEq.h
LinearAffineEq_test.cpp
md5.c
md5.h
MixingBijections.cpp
MixingBijections.h
NTLUtils.cpp
NTLUtils.h
WBAES.cpp
WBAES.h
WBAESGenerator.cpp
WBAESGenerator.h)
add_executable(main ${SOURCE_FILES} main.cpp)
add_executable(testing ${SOURCE_FILES} testing.cpp testing.h)
# NTL
if (NTL_NO_DEFAULT_PATH)
set(NTL_MODIF NO_DEFAULT_PATH)
message("Not using default paths for NTL search, ${NTL_MODIF}")
endif (NTL_NO_DEFAULT_PATH)
message("HOME: $ENV{HOME}")
find_path(NTL_INCLUDE_PATH NAMES NTL/mat_GF2.h PATHS $ENV{HOME}/ntl $ENV{HOME}/ntl/include /usr/local /opt/local /usr ${NTL_MODIF})
message("NTL_INCLUDE_PATH: ${NTL_INCLUDE_PATH}")
find_library(NTL_LIB ntl PATHS ${CMAKE_CURRENT_SOURCE_DIR} $ENV{HOME}/ntl $ENV{HOME}/ntl/lib /usr/local /opt/local /usr ${NTL_MODIF})
if(NOT NTL_LIB)
message(FATAL_ERROR "ntl library not found. Rerun cmake with -DCMAKE_PREFIX_PATH=\"<path to lib1>;<path to lib2>\"")
endif()
message("NTL_LIB: ${NTL_LIB}")
include_directories(${NTL_INCLUDE_PATH})
# BOOST
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED COMPONENTS program_options serialization iostreams random)
include_directories(${Boost_INCLUDE_DIRS})
# Linking
target_link_libraries(main ${NTL_LIB} ${Boost_LIBRARIES})
target_link_libraries(testing ${NTL_LIB} ${Boost_LIBRARIES})