-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
94 lines (77 loc) · 2.75 KB
/
Copy pathCMakeLists.txt
File metadata and controls
94 lines (77 loc) · 2.75 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
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
cmake_minimum_required (VERSION 3.8)
cmake_policy(SET CMP0069 NEW)
project(wepp)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
configure_file(src/version.hpp.in version.hpp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -Wall -Wno-unused-function -Wno-deprecated-declarations")
set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address -O0 -ggdb3 -fno-eliminate-unused-debug-symbols")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(DEFINED ENV{CONDA_PREFIX} AND EXISTS "$ENV{CONDA_PREFIX}/include/google/protobuf/stubs/common.h")
message(STATUS "Protobuf headers found in Conda. Using Conda paths.")
set(Protobuf_INCLUDE_DIR "$ENV{CONDA_PREFIX}/include" CACHE PATH "" FORCE)
if(APPLE)
set(Protobuf_LIBRARY "$ENV{CONDA_PREFIX}/lib/libprotobuf.dylib" CACHE FILEPATH "" FORCE)
else()
set(Protobuf_LIBRARY "$ENV{CONDA_PREFIX}/lib/libprotobuf.so" CACHE FILEPATH "" FORCE)
endif()
else()
message(STATUS "Protobuf not found in Conda (or not using Conda). Using System paths.")
unset(Protobuf_INCLUDE_DIR CACHE)
unset(Protobuf_LIBRARY CACHE)
endif()
if(DEFINED Protobuf_PATH)
find_package(Protobuf REQUIRED HINTS ${Protobuf_PATH})
else()
find_package(Protobuf REQUIRED)
endif()
# Print version messages
if(Protobuf_FOUND)
message(STATUS "Using Protocol Buffers ${Protobuf_VERSION}")
endif()
find_package(MPI REQUIRED)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
include_directories(${Protobuf_INCLUDE_DIRS})
find_package(TBB REQUIRED)
find_package(Boost COMPONENTS program_options iostreams filesystem date_time REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
file(GLOB WBE_SRCS "src/WEPP/*.cpp" "src/WEPP/*.hpp")
if(DEFINED Protobuf_PATH)
protobuf_generate(
LANGUAGE cpp
TARGET wepp
PROTOS sam.proto)
protobuf_generate(
LANGUAGE cpp
TARGET wepp
PROTOS parsimony.proto)
add_executable(wepp
${WBE_SRCS} ${PANMAT_SRCS}
)
add_executable(closest_peak_clustering
src/closest_peak_clustering.cpp
)
else()
protobuf_generate_cpp(
PROTO_SRCS PROTO_HDRS
parsimony.proto)
protobuf_generate_cpp(
SAM_SRCS SAM_HDRS
sam.proto)
add_executable(wepp
${WBE_SRCS}
src/mutation_annotated_tree.cpp
src/usher_mapper.cpp
${PROTO_SRCS} ${SAM_SRCS}
${PROTO_HDRS} ${SAM_HDRS}
)
add_executable(closest_peak_clustering
src/closest_peak_clustering.cpp
)
endif()
target_link_libraries(wepp PRIVATE stdc++ ${Boost_LIBRARIES} TBB::tbb ${Protobuf_LIBRARIES})
target_link_libraries(closest_peak_clustering PRIVATE stdc++ TBB::tbb)