forked from vcflib/vcflib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
203 lines (184 loc) · 4.3 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
199
200
201
202
203
cmake_minimum_required(VERSION 2.8)
project(vcflib)
option(OPENMP "Enable OpenMP" OFF)
option(PROFILING "Enable profiling" OFF)
option(GPROF "Enable gprof profiling" OFF)
include(ExternalProject)
include(FeatureSummary)
#include(FindLibLZMA)
#include(ExternalProject)
include(FindZLIB)
include(FindBZip2)
include(FindLibLZMA)
find_package(ZLIB)
set_package_properties(ZLIB PROPERTIES TYPE REQUIRED)
#find_package(LIBLZMA)
#set_package_properties(LIBLZMA PROPERTIES TYPE REQUIRED)
find_package(Threads)
set_package_properties(Threads PROPERTIES TYPE REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -D_FILE_OFFSET_BITS=64")
if(OPENMP)
find_package(OpenMP REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif(OPENMP)
if(PROFILING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif(PROFILING)
if(GPROF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
endif(GPROF)
include_directories(include)
include_directories(tabixpp)
include_directories(tabixpp/htslib)
include_directories(fastahack)
include_directories(intervaltree)
include_directories(smithwaterman)
include_directories(multichoose)
include_directories(filevercmp)
add_library(vcflib STATIC
src/Variant.h
src/split.h
src/pdflib.hpp
src/var.hpp
src/cdflib.hpp
src/rnglib.hpp
src/join.h
src/Variant.cpp
src/rnglib.cpp
src/var.cpp
src/pdflib.cpp
src/cdflib.cpp
src/split.cpp
src/ssw.hpp
src/ssw_cpp.hpp
tabixpp/tabix.cpp
fastahack/Fasta.cpp
smithwaterman/SmithWatermanGotoh.cpp
smithwaterman/Repeats.cpp
smithwaterman/IndelAllele.cpp
smithwaterman/disorder.cpp
smithwaterman/LeftAlign.cpp
fsom/fsom.c
filevercmp/filevercmp.c
)
set(BINS
vcfecho
dumpContigsFromHeader
bFst
pVst
hapLrt
popStats
wcFst
iHS
segmentFst
segmentIhs
genotypeSummary
sequenceDiversity
pFst
smoother
vcfld
plotHaps
abba-baba
permuteGPAT++
permuteSmooth
normalize-iHS
meltEHH
vcfaltcount
vcfhetcount
vcfhethomratio
vcffilter
vcf2tsv
vcfgenotypes
vcfannotategenotypes
vcfcommonsamples
vcfremovesamples
vcfkeepsamples
vcfsamplenames
vcfgenotypecompare
vcffixup
vcfclassify
vcfsamplediff
vcfremoveaberrantgenotypes
vcfrandom
vcfparsealts
vcfstats
vcfflatten
vcfprimers
vcfnumalt
vcfcleancomplex
vcfintersect
vcfannotate
vcfallelicprimitives
vcfoverlay
vcfaddinfo
vcfkeepinfo
vcfkeepgeno
vcfafpath
vcfcountalleles
vcflength
vcfdistance
vcfrandomsample
vcfentropy
vcfglxgt
vcfroc
vcfcheck
vcfstreamsort
vcfuniq
vcfuniqalleles
vcfremap
vcf2fasta
vcfsitesummarize
vcfbreakmulti
vcfcreatemulti
vcfevenregions
vcfcat
vcfgenosummarize
vcfgenosamplenames
vcfgeno2haplo
vcfleftalign
vcfcombine
vcfgeno2alleles
vcfindex
vcf2dag
vcfsample2info
vcfqual2info
vcfinfo2qual
vcfglbound
vcfinfosummarize)
execute_process(COMMAND git describe --abbrev=4 --dirty --always
OUTPUT_VARIABLE GIT_VERSION
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
ExternalProject_Add(htslib-build
SOURCE_DIR ${CMAKE_SOURCE_DIR}/tabixpp/htslib
BINARY_DIR ${CMAKE_SOURCE_DIR}/tabixpp/htslib
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/htslib
CONFIGURE_COMMAND ""
BUILD_COMMAND $(MAKE) lib-static
INSTALL_COMMAND ""
)
add_library(htslib STATIC IMPORTED)
set_property(TARGET htslib PROPERTY
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/tabixpp/htslib/libhts.a)
add_dependencies(htslib htslib-build)
add_definitions(-DVERSION="${GIT_VERSION}")
if (NOT BUILD_ONLY_LIB)
foreach(BIN ${BINS})
add_executable(${BIN} src/${BIN}.cpp)
target_link_libraries(${BIN} vcflib htslib ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} ${LIBLZMA_LIBRARIES} ${BZIP2_LIBRARIES})
endforeach(BIN ${BINS})
install(TARGETS ${BINS} RUNTIME DESTINATION bin)
endif()
install(TARGETS vcflib ARCHIVE DESTINATION lib)
file(GLOB INCLUDES
src/*.h*
multichoose/*.h*
intervaltree/*.h*
tabixpp/*.h*
smithwaterman/*.h*
fastahack/*.h*
filevercmp/*.h*)
install(FILES ${INCLUDES} DESTINATION include)
feature_summary(
FATAL_ON_MISSING_REQUIRED_PACKAGES
WHAT REQUIRED_PACKAGES_NOT_FOUND)