-
Notifications
You must be signed in to change notification settings - Fork 45
/
CMakeLists.txt
198 lines (172 loc) · 5.12 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
cmake_minimum_required(VERSION 3.10)
# Set the C++ standard required for the project
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set O2 optimization
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
project(svaba)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/SeqLib)
# Include directories for headers
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/SeqLib
${CMAKE_CURRENT_SOURCE_DIR}/SeqLib/bwa
${CMAKE_CURRENT_SOURCE_DIR}/SeqLib/fermi-lite
)
# Look for htslib on the system
find_package(htslib QUIET)
# Find required system level type libraries
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
## libcurl
# Find libcurl or allow user-specified path
find_package(CURL)
if(CURL_FOUND)
message(STATUS "Found CURL: ${CURL_LIBRARIES}")
else()
message(WARNING "CURL not found. You can specify the path with -DCURL_LIBRARY=<path_to_curl> and -DCURL_INCLUDE_DIR=<path_to_headers>.")
set(CURL_LIBRARY CACHE STRING "Path to libcurl library")
set(CURL_INCLUDE_DIR CACHE STRING "Path to libcurl include directory")
endif()
## LZMA
find_path(LZMA_INCLUDE_DIR NAMES lzma.h)
find_library(LZMA_LIBRARY NAMES lzma)
if(NOT LZMA_INCLUDE_DIR OR NOT LZMA_LIBRARY)
message(FATAL_ERROR "LZMA library or headers not found!")
endif()
## BZip2
find_package(BZip2 REQUIRED)
## HTSLIB
if (htslib_FOUND)
# If htslib was found on the system, use it
message(STATUS "Using system htslib")
else()
set(HTSLIB_DIR "" CACHE PATH "Path to HTSLib root directory")
if (NOT HTSLIB_DIR)
message(FATAL_ERROR "HTSLIB_DIR not specified. Please specify -DHTSLIB_DIR=/path/to/htslib")
else()
# Automatically set include and library paths based on HTSLIB_DIR
include_directories(${HTSLIB_DIR}/include)
link_directories(${HTSLIB_DIR}/lib)
endif()
endif()
# Find all source files
set(SOURCES
src/svaba/run_svaba.cpp
src/svaba/BreakPoint.cpp
src/svaba/AlignedContig.cpp
src/svaba/AlignmentFragment.cpp
src/svaba/DiscordantCluster.cpp
src/svaba/DBSnpFilter.cpp
src/svaba/PONFilter.cpp
src/svaba/svabaUtils.cpp
src/svaba/svaba.cpp
src/svaba/svabaAssemblerEngine.cpp
src/svaba/tovcf.cpp
src/svaba/vcf.cpp
src/svaba/DiscordantRealigner.cpp
src/svaba/svabaOverlapAlgorithm.cpp
src/svaba/svabaASQG.cpp
src/svaba/svabaAssemble.cpp
src/svaba/KmerFilter.cpp
src/svaba/svabaBamWalker.cpp
src/svaba/refilter.cpp
src/svaba/LearnBamParams.cpp
src/svaba/STCoverage.cpp
src/svaba/Histogram.cpp
src/svaba/BamStats.cpp
src/svaba/svabaRead.cpp
src/SGA/SuffixTools/STCommon.cpp
src/SGA/SuffixTools/Occurrence.cpp
src/SGA/SuffixTools/SuffixArray.cpp
src/SGA/SuffixTools/SuffixCompare.cpp
src/SGA/SuffixTools/InverseSuffixArray.cpp
src/SGA/SuffixTools/SACAInducedCopying.cpp
src/SGA/SuffixTools/BWTAlgorithms.cpp
src/SGA/SuffixTools/BWTReader.cpp
src/SGA/SuffixTools/BWTWriter.cpp
src/SGA/SuffixTools/SAReader.cpp
src/SGA/SuffixTools/SAWriter.cpp
src/SGA/SuffixTools/SBWT.cpp
src/SGA/SuffixTools/RLBWT.cpp
src/SGA/SuffixTools/BWTWriterBinary.cpp
src/SGA/SuffixTools/BWTReaderBinary.cpp
src/SGA/SuffixTools/BWTWriterAscii.cpp
src/SGA/SuffixTools/BWTReaderAscii.cpp
src/SGA/SuffixTools/BWTIntervalCache.cpp
src/SGA/SuffixTools/SampledSuffixArray.cpp
src/SGA/Algorithm/OverlapAlgorithm.cpp
src/SGA/Algorithm/DPAlignment.cpp
src/SGA/Algorithm/SearchSeed.cpp
src/SGA/Algorithm/OverlapBlock.cpp
src/SGA/Algorithm/SearchHistory.cpp
src/SGA/Algorithm/OverlapTools.cpp
src/SGA/Bigraph/Bigraph.cpp
src/SGA/Bigraph/Vertex.cpp
src/SGA/Bigraph/Edge.cpp
src/SGA/Bigraph/EdgeDesc.cpp
src/SGA/SGA/OverlapCommon.cpp
src/SGA/SQG/SQG.cpp
src/SGA/SQG/ASQG.cpp
src/SGA/StringGraph/SGUtil.cpp
src/SGA/StringGraph/SGAlgorithms.cpp
src/SGA/StringGraph/SGVisitors.cpp
src/SGA/StringGraph/CompleteOverlapSet.cpp
src/SGA/StringGraph/RemovalAlgorithm.cpp
src/SGA/StringGraph/SGSearch.cpp
src/SGA/StringGraph/SGWalk.cpp
src/SGA/Util/Util.cpp
src/SGA/Util/stdaln.c
src/SGA/Util/Alphabet.cpp
src/SGA/Util/Contig.cpp
src/SGA/Util/ReadTable.cpp
src/SGA/Util/ReadInfoTable.cpp
src/SGA/Util/SeqReader.cpp
src/SGA/Util/DNAString.cpp
src/SGA/Util/Match.cpp
src/SGA/Util/Pileup.cpp
src/SGA/Util/Interval.cpp
src/SGA/Util/SeqCoord.cpp
src/SGA/Util/QualityVector.cpp
src/SGA/Util/Quality.cpp
src/SGA/Util/PrimerScreen.cpp
src/SGA/Util/CorrectionThresholds.cpp
src/SGA/Util/ClusterReader.cpp
src/SGA/Util/QualityTable.cpp
src/SGA/Util/gzstream.C
src/SGA/Util/BitChar.cpp
src/SGA/Util/MultiOverlap.cpp
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
src/SGA/Algorithm
src/SGA/StringGraph
src/SGA/SGA
src/SGA/SuffixTools
src/SGA/Util
src/SGA/SQG
src/SGA/Bigraph
src/svaba
src/SGA
)
# Generate the executable
add_executable(svaba ${SOURCES})
# If the submodules already have Makefiles, you can use custom commands to invoke make
# in those directories.
add_custom_target(
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# Linking
target_link_libraries(svaba
seqlib
${CMAKE_CURRENT_SOURCE_DIR}/SeqLib/bwa/libbwa.a
${CMAKE_CURRENT_SOURCE_DIR}/SeqLib/fermi-lite/libfml.a
Threads::Threads
hts
ZLIB::ZLIB
${CURL_LIBRARY}
${LZMA_LIBRARY}
BZip2::BZip2
)