-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (61 loc) · 2.57 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
cmake_minimum_required(VERSION 3.20)
project(RePairCompression)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif ()
set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++17 -pedantic -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstandalone-debug -fprofile-instr-generate -fcoverage-mapping")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -lgcov --coverage")
endif ()
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(src)
set(SRC_FILES
src/Entry.hpp
src/HashTable.cpp
src/HashTable.hpp
src/PriorityQueue.cpp
src/PriorityQueue.hpp
src/RePairCompression.cpp
src/RePairCompression.hpp
src/RePairDataStructureConcrete.cpp
src/RePairDataStructureConcrete.hpp
src/Record.hpp
src/RepairCoder.cpp
src/RepairCoder.hpp
src/TranslateTable.cpp
src/TranslateTable.hpp
src/ValuePair.cpp
src/ValuePair.hpp
src/CommonDefinitions.hpp
src/Serialization.cpp
src/Serialization.hpp
src/EntryPair.cpp
src/EntryPair.hpp
src/LPRecordHTable.cpp
src/LPRecordHTable.hpp
)
add_library(RePairCompression ${SRC_FILES})
add_executable(CompressFile scripts/CompressFile.cpp)
target_link_libraries(CompressFile RePairCompression)
add_executable(DecompressFile scripts/DecompressFile.cpp)
target_link_libraries(DecompressFile RePairCompression)
find_package(GTest QUIET)
if (GTest_FOUND)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(RepairCompressionUsabilityTest test/RepairCompressionUsabilityTest.cpp)
target_link_libraries(RepairCompressionUsabilityTest RePairCompression ${GTEST_BOTH_LIBRARIES})
add_test(NAME RepairCompressionUsabilityTest COMMAND ./RepairCompressionUsabilityTest)
add_executable(LPRecordHTableTest test/LPRecordHTableTest.cpp)
target_link_libraries(LPRecordHTableTest RePairCompression ${GTEST_BOTH_LIBRARIES})
add_test(NAME LPRecordHTableTest COMMAND ./LPRecordHTableTest)
endif ()
add_executable(benchmark_10M_same benchmarking/benchmark_10M_same.cpp)
target_link_libraries(benchmark_10M_same RePairCompression)