-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (69 loc) · 2.97 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
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 2.6)
set(CMAKE_CXX_STANDARD 20)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()
#set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/.. )
project (s-rlbwt)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/internal)
# malloc_count
add_library(malloc_count INTERFACE)
target_sources(malloc_count INTERFACE "${CMAKE_SOURCE_DIR}/external/malloc_count/malloc_count.c")
target_include_directories(malloc_count INTERFACE "${CMAKE_SOURCE_DIR}/external/malloc_count/")
target_link_libraries(malloc_count INTERFACE dl)
# sdsl
include_directories("~/include")
link_directories("~/lib")
message("Building in ${CMAKE_BUILD_TYPE} mode")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb -g")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -fstrict-aliasing -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -ggdb -Ofast -fstrict-aliasing")
# ips4o
add_subdirectory("${CMAKE_SOURCE_DIR}/external/ips4o")
set_target_properties(ips4o_example PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
# unordered_dense
add_subdirectory("${CMAKE_SOURCE_DIR}/external/unordered_dense/")
# libsais
set(LIBSAIS_USE_OPENMP OFF CACHE BOOL "" FORCE)
add_subdirectory("${CMAKE_SOURCE_DIR}/external/libsais/")
include_directories("${CMAKE_SOURCE_DIR}/external/ips4o/include/")
include_directories("${CMAKE_SOURCE_DIR}/external/unordered_dense/include/")
add_executable(ri-build ri-build.cpp)
TARGET_LINK_LIBRARIES(ri-build sdsl)
TARGET_LINK_LIBRARIES(ri-build divsufsort)
TARGET_LINK_LIBRARIES(ri-build divsufsort64)
TARGET_LINK_LIBRARIES(ri-build ips4o)
TARGET_LINK_LIBRARIES(ri-build unordered_dense)
TARGET_LINK_LIBRARIES(ri-build libsais)
TARGET_LINK_LIBRARIES(ri-build malloc_count)
add_executable(ri-locate ri-locate.cpp)
TARGET_LINK_LIBRARIES(ri-locate sdsl)
TARGET_LINK_LIBRARIES(ri-locate divsufsort)
TARGET_LINK_LIBRARIES(ri-locate divsufsort64)
TARGET_LINK_LIBRARIES(ri-locate libsais)
TARGET_LINK_LIBRARIES(ri-locate malloc_count)
add_executable(ri-count ri-count.cpp)
TARGET_LINK_LIBRARIES(ri-count sdsl)
TARGET_LINK_LIBRARIES(ri-count divsufsort)
TARGET_LINK_LIBRARIES(ri-count divsufsort64)
TARGET_LINK_LIBRARIES(ri-count libsais)
TARGET_LINK_LIBRARIES(ri-count malloc_count)
#add_executable(ri-space ri-space.cpp)
#TARGET_LINK_LIBRARIES(ri-space sdsl)
#TARGET_LINK_LIBRARIES(ri-space divsufsort)
#TARGET_LINK_LIBRARIES(ri-space divsufsort64)
enable_testing()
include(GoogleTest)
include(Dart)
add_executable(test "${CMAKE_SOURCE_DIR}/tests/test.cpp")
TARGET_LINK_LIBRARIES(test sdsl)
TARGET_LINK_LIBRARIES(test divsufsort)
TARGET_LINK_LIBRARIES(test divsufsort64)
TARGET_LINK_LIBRARIES(test libsais)
TARGET_LINK_LIBRARIES(test gtest_main)
TARGET_LINK_LIBRARIES(test malloc_count)
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests/")
gtest_discover_tests(test)