forked from tihomirkonosic/heron-raven
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
134 lines (110 loc) · 3.28 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
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(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(racon 3.0.1 QUIET)
if (NOT racon_FOUND)
FetchContent_Declare(
racon
GIT_REPOSITORY https://github.com/lbcb-sci/racon
GIT_TAG library)
FetchContent_GetProperties(racon)
if (NOT racon_POPULATED)
FetchContent_Populate(racon)
add_subdirectory(
${racon_SOURCE_DIR}
${racon_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
if (raven_build_tests)
find_package(GTest 1.10.0 QUIET)
if (NOT GTest_FOUND)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG release-1.10.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)
target_link_libraries(raven
cereal::cereal
racon::racon)
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
bioparser::bioparser)
if (racon_enable_cuda)
target_compile_definitions(raven_exe PRIVATE CUDA_ENABLED)
endif ()
target_compile_definitions(raven_exe PRIVATE VERSION="${PROJECT_VERSION}")
set_property(TARGET raven_exe PROPERTY OUTPUT_NAME raven)
install(TARGETS raven_exe DESTINATION ${CMAKE_INSTALL_BINDIR})
if (raven_build_tests)
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/")
endif ()