-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
64 lines (57 loc) · 1.77 KB
/
Copy pathCMakeLists.txt
File metadata and controls
64 lines (57 loc) · 1.77 KB
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
cmake_minimum_required(VERSION 3.20)
project(seqtree LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif() # MSVC Release already uses /O2; -O3 is not a valid MSVC flag
option(SEQTREE_TESTS "Build C++ tests" OFF)
option(SEQTREE_BENCH "Build C++ benchmarks" OFF)
option(SEQTREE_PYTHON "Build the pybind11 module" OFF)
find_package(Threads REQUIRED)
add_library(seqtree_core STATIC
src/codec.cpp
src/substitution_matrix.cpp
src/positional_matrix.cpp
src/kmer_index.cpp
src/trie.cpp
src/index.cpp
src/engine_seqtm.cpp
src/engine_seqtrie.cpp
src/searcher.cpp
src/gapblock.cpp
src/pairwise.cpp
src/distance.cpp
)
target_include_directories(seqtree_core PUBLIC include PRIVATE src)
target_link_libraries(seqtree_core PUBLIC Threads::Threads)
if(SEQTREE_PYTHON)
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(_core src/_bindings.cpp)
target_link_libraries(_core PRIVATE seqtree_core)
install(TARGETS _core DESTINATION seqtree)
endif()
if(SEQTREE_TESTS)
enable_testing()
add_executable(seqtree_tests
tests/cpp/test_codec.cpp
tests/cpp/test_matrix.cpp
tests/cpp/test_trie.cpp
tests/cpp/test_engines.cpp
tests/cpp/test_edge.cpp
tests/cpp/test_serialize.cpp
tests/cpp/test_positional.cpp
tests/cpp/test_kmer_index.cpp
)
target_include_directories(seqtree_tests PRIVATE tests/cpp src)
target_link_libraries(seqtree_tests PRIVATE seqtree_core)
add_test(NAME seqtree_tests COMMAND seqtree_tests)
endif()
if(SEQTREE_BENCH)
add_executable(seqtree_bench bench/bench_seqtree.cpp)
target_link_libraries(seqtree_bench PRIVATE seqtree_core)
endif()