-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
162 lines (121 loc) · 3.41 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
cmake_minimum_required(VERSION 3.14)
#set(CMAKE_C_COMPILER "gcc")
#set(CMAKE_CXX_COMPILER "g++")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
# set(CMAKE_BUILD_TYPE Debug)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
project(povu)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
if (MSVC)
# warning level 4
add_compile_options(/W4)
else()
# additional warnings
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Include libhandlegraph library
add_subdirectory(
# deps/gfakluge
deps/libhandlegraph
)
ADD_LIBRARY(LibsModule
# io
src/io/from_gfa.cpp
# graph
src/graph/tree.cpp
src/graph/u_graph.cpp
src/graph/digraph.cpp
src/graph/bidirected.cpp
src/graph/biedged.cpp
src/graph/spanning_tree.cpp
# trees
#src/vst/vst.cpp
#src/vst/pst.cpp
src/pvst/pvst.cpp
src/pst/pst.cpp
# genomics
src/genomics/variant_calling.cpp
src/genomics/vcf.cpp
# algorithms
src/algorithms/cycle_equiv.cpp
# cli
src/cli/cli.cpp
src/core/core.cpp
src/core/utils.cpp
)
#include_directories(
# ./deps/gfakluge/src
# ./deps/gfakluge/src/tinyFA
# ./deps/libhandlegraph/src/include
#)
include_directories(
# deps
${CMAKE_CURRENT_SOURCE_DIR}/deps/args/
${CMAKE_CURRENT_SOURCE_DIR}/deps/gfakluge/src
${CMAKE_CURRENT_SOURCE_DIR}/deps/gfakluge/src/tinyFA
${CMAKE_CURRENT_SOURCE_DIR}/deps/libhandlegraph/src/include
)
set(SOURCE_FILES
src/main.cpp
)
# source
add_executable(povu
${SOURCE_FILES}
)
# recommended but does not work
# Specify the include directories for the target
#target_include_directories(povu
# PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/deps/gfakluge/src
# ${CMAKE_CURRENT_SOURCE_DIR}/deps/gfakluge/src/tinyFA
# ${CMAKE_CURRENT_SOURCE_DIR}/deps/libhandlegraph/src/include
#)
#target_include_directories(povu PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/build/libs/libhandlegraph)
#
# Link the library (LibsModule) and libhandlegraph to your executable
#target_link_libraries(
# povu
# LibsModule
# handlegraph_static
#)
# Link the library (LibsModule) and libhandlegraph to your executable
target_link_libraries(povu PRIVATE LibsModule handlegraph_shared)
set(BINARY_DIR ./bin)
file(MAKE_DIRECTORY ${BINARY_DIR}/)
add_custom_command(TARGET povu
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:povu> ../${BINARY_DIR}/)
add_executable( povu_test
tests/main_tests.cc
)
#target_link_libraries(
# povu_test
# LibsModule
# handlegraph
# GTest::gtest_main
#)
# Link the library (LibsModule), libhandlegraph, and Google Test to your test executable
target_link_libraries(povu_test PRIVATE LibsModule handlegraph_static GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(povu_test)