forked from lbcb-sci/raven
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
182 lines (152 loc) · 4.29 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
cmake_minimum_required(VERSION 3.11)
project(raven VERSION 1.5.0
LANGUAGES CXX
DESCRIPTION "Raven is a de novo genome assembler for long uncorrected reads.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
include(FetchContent)
include(GNUInstallDirs)
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(raven_main_project ON)
endif ()
option(raven_build_tests "Build unit tests" ${raven_main_project})
find_package(biosoup 0.10.0 QUIET)
if (NOT biosoup_FOUND)
FetchContent_Declare(
biosoup
GIT_REPOSITORY https://github.com/rvaser/biosoup
GIT_TAG 0.10.0)
FetchContent_GetProperties(biosoup)
if (NOT biosoup_POPULATED)
FetchContent_Populate(biosoup)
add_subdirectory(
${biosoup_SOURCE_DIR}
${biosoup_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
find_package(bioparser 3.0.13 QUIET)
if (NOT bioparser_FOUND)
FetchContent_Declare(
bioparser
GIT_REPOSITORY https://github.com/rvaser/bioparser
GIT_TAG 3.0.13)
FetchContent_GetProperties(bioparser)
if (NOT bioparser_POPULATED)
FetchContent_Populate(bioparser)
add_subdirectory(
${bioparser_SOURCE_DIR}
${bioparser_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
find_package(cereal 1.3.0 QUIET)
if (NOT cereal_FOUND)
FetchContent_Declare(
cereal
GIT_REPOSITORY https://github.com/USCiLab/cereal
GIT_TAG v1.3.0)
FetchContent_GetProperties(cereal)
if (NOT cereal_POPULATED)
FetchContent_Populate(cereal)
add_subdirectory(
${cereal_SOURCE_DIR}
${cereal_BINARY_DIR}
EXCLUDE_FROM_ALL)
add_library(cereal::cereal ALIAS cereal)
endif ()
endif ()
find_package(ram 1.0.0 QUIET)
if (NOT ram_FOUND)
FetchContent_Declare(
ram
GIT_REPOSITORY https://github.com/kocijan/ram
GIT_TAG kocijan/hpc)
FetchContent_GetProperties(ram)
if (NOT ram_POPULATED)
FetchContent_Populate(ram)
add_subdirectory(
${ram_SOURCE_DIR}
${ram_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
find_package(edlib 1.2.7 QUIET)
if (NOT edlib_FOUND)
FetchContent_Declare(
edlib
GIT_REPOSITORY https://github.com/martinsos/edlib
GIT_TAG v1.2.7)
FetchContent_GetProperties(edlib)
if (NOT edlib_POPULATED)
FetchContent_Populate(edlib)
add_subdirectory(
${edlib_SOURCE_DIR}
${edlib_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
if (raven_build_tests)
find_package(GTest 1.14.0 QUIET)
if (NOT GTest_FOUND)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG v1.14.0)
FetchContent_GetProperties(googletest)
if (NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(
${googletest_SOURCE_DIR}
${googletest_BINARY_DIR}
EXCLUDE_FROM_ALL)
add_library(GTest::Main ALIAS gtest_main)
endif ()
endif ()
endif ()
add_library(raven
src/graph.cpp
src/pile.cpp
src/node.cpp
src/edge.cpp
src/parser.cpp
src/graph_constructor/graph_constructor.cpp
src/graph_assembler/graph_assembler.cpp
src/option_manager.cpp
src/graph_constructor/overlap_parser.cpp
#src/extended_overlap.cpp
#src/read_preprocessing.cpp
)
target_link_libraries(raven
cereal::cereal
biosoup::biosoup
bioparser::bioparser
ram::ram
edlib::edlib)
target_include_directories(raven PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
add_executable(raven_exe
src/main.cpp
)
target_link_libraries(raven_exe
raven)
target_compile_definitions(raven PUBLIC RAVEN_VERSION="${PROJECT_VERSION}")
set_property(TARGET raven_exe PROPERTY OUTPUT_NAME raven)
install(TARGETS raven_exe DESTINATION ${CMAKE_INSTALL_BINDIR})
if (raven_build_tests)
enable_testing()
add_executable(raven_test
test/raven_test.cpp)
target_link_libraries(raven_test
raven
bioparser::bioparser
GTest::Main)
target_compile_definitions(raven_test
PRIVATE TEST_DATA="${PROJECT_SOURCE_DIR}/test/data/")
gtest_add_tests(TARGET raven_test SOURCES test/raven_test.cpp)
endif ()