-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
169 lines (141 loc) · 5.63 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
cmake_minimum_required(VERSION 3.9)
project(PepSIRF LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
find_package(OpenMP)
find_package(ZLIB)
find_package(Boost REQUIRED COMPONENTS program_options regex filesystem iostreams)
include_directories(include/modules/core)
include_directories(include/modules/normalize)
include_directories(include/modules/parsers)
include_directories(include/modules/demux)
include_directories(include/modules/deconv)
include_directories(include/modules/subjoin)
include_directories(include/modules/zscore)
include_directories(include/modules/bin)
include_directories(include/modules/link)
include_directories(include/modules/enrich)
include_directories(include/modules/info)
include_directories(lib)
add_compile_options( "-Wall" "-std=c++11" "-Wextra" "-fvisibility=hidden"
"-fvisibility-inlines-hidden"
"$<$<CONFIG:DEBUG>:-O0;-g>"
"$<$<CONFIG:RELEASE>:-O3>"
"$<$<CONFIG:RELEASE>:-w>"
)
set(PepSIRF_MODULES
pepsirf_common
modules_demux modules_deconv
modules_normalize modules_subjoin
modules_zscore modules_bin
modules_link
modules_enrich
modules_info
)
list( APPEND PepSIRF_LINK_LIBS
${PepSIRF_MODULES}
${Boost_LIBRARIES}
)
if(OpenMP_FOUND)
message( "OpenMP enabled" )
list( APPEND PepSIRF_LINK_LIBS OpenMP::OpenMP_CXX )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp")
add_definitions( -DENABLE_OPENMP )
else()
message( "WARNING: OpenMP not found, parallelism disabled." )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-unused-value")
endif()
if(ZLIB_FOUND)
message( "Gzip file manipulation enabled." )
add_definitions( -DZLIB_ENABLED )
list( APPEND PepSIRF_LINK_LIBS ZLIB::ZLIB )
else()
message( "WARNING: ZLIB was not found, demux cannot process gzipped files." )
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include_directories(${Boost_INCLUDE_DIRS})
add_executable(pepsirf src/main.cpp)
# Library common to all modules
add_library(pepsirf_common STATIC src/modules/parsers/options_parser.cpp src/modules/core/options.cpp
src/modules/core/sequence.cpp
src/modules/core/file_io.cpp
src/modules/parsers/fastq_parser.cpp src/modules/parsers/fasta_parser.cpp
src/modules/core/module.cpp
src/modules/core/sequence_indexer.cpp
src/modules/core/fastq_score.cpp
src/modules/core/fs_tools.cpp
src/modules/core/peptide.cpp
src/modules/core/module_initializer.cpp
src/modules/core/cli_validator.cpp
src/modules/core/modules.cpp
src/modules/core/peptide_scoring.cpp
src/modules/core/predicate.cpp
)
add_library(modules_demux STATIC src/modules/demux/options_demux.cpp src/modules/demux/options_parser_demux.cpp src/modules/parsers/options_parser.cpp
src/modules/core/options.cpp
src/modules/core/file_io.cpp
src/modules/core/module.cpp src/modules/demux/module_demux.cpp
src/modules/parsers/fasta_parser.cpp src/modules/parsers/fastq_parser.cpp
src/modules/core/sequence.cpp
src/modules/demux/samplelist_parser.cpp
src/modules/demux/fif_parser.cpp
src/modules/demux/translation_map.cpp
src/modules/core/sequence_indexer.cpp
src/modules/core/fastq_score.cpp
)
add_library( modules_deconv STATIC src/modules/deconv/options_deconv.cpp src/modules/deconv/options_parser_deconv.cpp
src/modules/core/module.cpp src/modules/deconv/module_deconv.cpp
src/modules/core/fs_tools.cpp
src/modules/deconv/scored_peptide.cpp
src/modules/core/peptide.cpp
src/modules/deconv/species_data.cpp
)
add_library( modules_normalize STATIC src/modules/normalize/options_normalize.cpp
src/modules/normalize/options_parser_normalize.cpp
src/modules/core/module.cpp src/modules/normalize/module_normalize.cpp
src/modules/core/peptide_scoring.cpp
)
add_library( modules_subjoin STATIC src/modules/subjoin/options_subjoin.cpp
src/modules/subjoin/options_parser_subjoin.cpp
src/modules/core/module.cpp src/modules/subjoin/module_subjoin.cpp
)
add_library( modules_zscore STATIC src/modules/zscore/module_zscore.cpp
src/modules/zscore/options_zscore.cpp
src/modules/zscore/options_parser_zscore.cpp
src/modules/bin/peptide_bin.cpp
)
add_library( modules_bin STATIC src/modules/bin/module_bin.cpp
src/modules/bin/options_bin.cpp
src/modules/bin/options_parser_bin.cpp
src/modules/bin/peptide_bin.cpp
src/modules/bin/probe_rank.cpp
)
add_library( modules_link STATIC src/modules/link/module_link.cpp
src/modules/link/options_link.cpp
src/modules/link/options_parser_link.cpp
src/modules/link/metadata_map.cpp
)
add_library( modules_enrich STATIC src/modules/enrich/module_enrich.cpp
src/modules/enrich/options_enrich.cpp
src/modules/enrich/options_parser_enrich.cpp
src/modules/core/predicate.cpp
)
add_library( modules_info STATIC src/modules/info/module_info.cpp
src/modules/info/options_info.cpp
src/modules/info/options_parser_info.cpp
)
option( BUILD_TESTS "Determines whether to build tests." ON )
if(BUILD_TESTS)
add_executable(pepsirf_test test/pepsirf_test.cpp)
add_definitions( -DMATRIX_CHECK_BOUNDS )
include_directories(pepsirf_test lib)
enable_testing()
target_link_libraries(pepsirf_test PUBLIC ${PepSIRF_LINK_LIBS} )
add_test( NAME test COMMAND pepsirf_test )
endif()
target_link_libraries(pepsirf PUBLIC ${PepSIRF_LINK_LIBS} )