-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
136 lines (112 loc) · 3.33 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
cmake_minimum_required(VERSION 3.11)
project(tarantula VERSION 0.0.1
LANGUAGES CXX
DESCRIPTION "Tarantula is a Hi-C scaffolder.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
set(CMAKE_CXX_STANDARD 11)
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(tarantula_main_project ON)
endif ()
option(tarantula_build_tests "Build unit tests" ${tarantula_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(ram 2.0.0 QUIET)
if (NOT ram_FOUND)
FetchContent_Declare(
ram
GIT_REPOSITORY https://github.com/lbcb-sci/ram
GIT_TAG 304536)
FetchContent_GetProperties(ram)
if (NOT ram_POPULATED)
FetchContent_Populate(ram)
add_subdirectory(
${ram_SOURCE_DIR}
${ram_BINARY_DIR}
EXCLUDE_FROM_ALL)
endif ()
endif ()
if (tarantula_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(tarantula
src/graph.cpp
src/pileogram.cpp)
add_library(directedforce
src/algorithm.cpp)
target_link_libraries(tarantula
directedforce
cereal::cereal
ram::ram)
target_include_directories(tarantula PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
add_executable(tarantula_exe
src/main.cpp)
target_link_libraries(tarantula_exe
tarantula
directedforce
bioparser::bioparser)
target_compile_definitions(tarantula_exe PRIVATE VERSION="${PROJECT_VERSION}")
set_property(TARGET tarantula_exe PROPERTY OUTPUT_NAME tarantula)
install(TARGETS tarantula_exe DESTINATION ${CMAKE_INSTALL_BINDIR})
if (tarantula_build_tests)
add_executable(tarantula_test
test/tarantula_test.cpp)
target_link_libraries(tarantula_test
tarantula
directedforce
bioparser::bioparser
GTest::Main)
target_compile_definitions(tarantula_test
PRIVATE TEST_DATA="${PROJECT_SOURCE_DIR}/test/data/")
endif ()