forked from U-Ar/br-index
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
80 lines (60 loc) · 2.35 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(br-index-mems CXX)
FIND_PACKAGE(Git QUIET)
SET(SDSL_INCLUDE "~/include") #SDSL headeres
SET(SDSL_LIB "~/lib") #SDSL lib
INCLUDE_DIRECTORIES(${SDSL_INCLUDE})
LINK_DIRECTORIES(${SDSL_LIB})
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-g -ggdb -Ofast -fstrict-aliasing -DNDEBUG -march=native")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -ggdb -Ofast -fstrict-aliasing -march=native")
ADD_SUBDIRECTORY(test)
INCLUDE_DIRECTORIES(src)
ADD_EXECUTABLE(bri-build src/bri-build.cpp)
TARGET_LINK_LIBRARIES(bri-build sdsl)
TARGET_LINK_LIBRARIES(bri-build divsufsort)
TARGET_LINK_LIBRARIES(bri-build divsufsort64)
ADD_EXECUTABLE(bri-count src/bri-count.cpp)
TARGET_LINK_LIBRARIES(bri-count sdsl)
TARGET_LINK_LIBRARIES(bri-count divsufsort)
TARGET_LINK_LIBRARIES(bri-count divsufsort64)
ADD_EXECUTABLE(bri-locate src/bri-locate.cpp)
TARGET_LINK_LIBRARIES(bri-locate sdsl)
TARGET_LINK_LIBRARIES(bri-locate divsufsort)
TARGET_LINK_LIBRARIES(bri-locate divsufsort64)
ADD_EXECUTABLE(bri-seedex src/bri-seedex.cpp)
TARGET_LINK_LIBRARIES(bri-seedex sdsl)
TARGET_LINK_LIBRARIES(bri-seedex divsufsort)
TARGET_LINK_LIBRARIES(bri-seedex divsufsort64)
ADD_EXECUTABLE(bri-space src/bri-space.cpp)
TARGET_LINK_LIBRARIES(bri-space sdsl)
TARGET_LINK_LIBRARIES(bri-space divsufsort)
TARGET_LINK_LIBRARIES(bri-space divsufsort64)
ADD_EXECUTABLE(bri-mem src/bri-mem.cpp)
TARGET_LINK_LIBRARIES(bri-mem sdsl)
TARGET_LINK_LIBRARIES(bri-mem divsufsort)
TARGET_LINK_LIBRARIES(bri-mem divsufsort64)
ADD_EXECUTABLE(efg-mems src/efg-mems.cpp)
TARGET_LINK_LIBRARIES(efg-mems sdsl)
TARGET_LINK_LIBRARIES(efg-mems divsufsort)
TARGET_LINK_LIBRARIES(efg-mems divsufsort64)
enable_testing()
add_executable(run_tests test/run_tests.cpp
test/sparse_sd_vector_test.cpp
test/huffman_string_test.cpp
test/rle_string_test.cpp
test/permuted_lcp_test.cpp
test/br_index_test.cpp
)
target_link_libraries(run_tests PRIVATE sdsl divsufsort divsufsort64)
target_include_directories(run_tests PRIVATE ${PROJECT_SOURCE_DIR}/external/iutest/include)
ADD_CUSTOM_TARGET(test-bri
COMMAND rm -rf test-tmp
COMMAND mkdir test-tmp
COMMAND ./run_tests
COMMAND rm -rf test-tmp
DEPENDS run_tests
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Execute run_tests."
)