forked from trendmicro/tlsh
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
58 lines (46 loc) · 1.47 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
cmake_minimum_required(VERSION 3.26)
project(
TLSH
VERSION 5.0.0
LANGUAGES CXX
DESCRIPTION "TLSH C++ implementation"
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
set(VCPKG_MANIFEST_MODE OFF)
set(CXX_STANDARD 20)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
option(TLSH_BUILD_BINDINGS "Build Python bindings" ON)
option(TLSH_BUILD_TESTS "Build tests" OFF)
option(TLSH_BUILD_WITH_ASAN "Build with Address Sanitizer" ON)
# TLSH uses only half the counting buckets.
# It can use all the buckets now.
set(TLSH_BUCKETS 128)
if(TLSH_BUCKETS EQUAL 48)
set(TLSH_HASH "min hash")
elseif(TLSH_BUCKETS EQUAL 128)
set(TLSH_HASH "compact hash")
elseif(TLSH_BUCKETS EQUAL 256)
set(TLSH_HASH "full hash")
else()
message(FATAL_ERROR "Invalid TLSH_BUCKETS value")
endif()
# TLSH uses 1 byte checksum. The collision rate is 1 in 24.
# It can use 3 bytes checksum now. That collision rate in 1 in 5800.
set(TLSH_CHECKSUM 1)
# setting TLSH_DISTANCE_PARAMETERS to 1 allows you to set command line arguments
# to set - and hence experiment with the distance parameters
# by default this is zero
set(TLSH_DISTANCE_PARAMETERS 0)
set(TLSH_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
add_subdirectory(src)
if(TLSH_BUILD_BINDINGS)
add_subdirectory(python)
endif(TLSH_BUILD_BINDINGS)
if(TLSH_BUILD_TESTS)
find_package(Catch2 REQUIRED)
include(CTest)
enable_testing()
endif(TLSH_BUILD_TESTS)