-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
151 lines (116 loc) · 3.62 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
cmake_minimum_required (VERSION 3.28)
include(FetchContent)
#set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR}/vcpkg_overlays/ ${CMAKE_SOURCE_DIR}/my-vcpkg-triplets)
#set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)
#set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# set(CMAKE_LINKER_TYPE LLD)
# endif()
#Static Analysis
#find_program(CMAKE_CXX_CPPCHECK cppcheck NAMES cppcheck HINTS $ENV{PROGRAMFILES}/cppcheck)
#if(CMAKE_CXX_CPPCHECK)
# list(APPEND CMAKE_CXX_CPPCHECK "--enable=all" "--suppressions-list=${CMAKE_SOURCE_DIR}/suppressions.txt" "--template=vs")
#endif()
project ("SynthesisSearch")
#if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# set(CMAKE_LINKER_TYPE LLD)
#endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_STANDARD 20) # Needed for Kokkos
#
# Dependencies
#
FetchContent_Declare(
kokkos
GIT_REPOSITORY https://github.com/kokkos/kokkos
GIT_TAG 15dc143e5f39949eece972a798e175c4b463d4b8
GIT_SHALLOW TRUE
)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG e69e5f977d458f2650bb346dadf2ad30c5320281
GIT_SHALLOW TRUE
) # 10.2.1
# Fetch WFA2-lib
FetchContent_Declare(
WFA2lib
GIT_REPOSITORY https://github.com/QuantumFelidae/WFA2-lib.git
GIT_TAG main
)
FetchContent_Declare(
unordered_dense
GIT_REPOSITORY https://github.com/martinus/unordered_dense.git
GIT_TAG v4.4.0
GIT_SHALLOW TRUE
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(Kokkos_ARCH_NATIVE ON)
endif()
#set(Kokkos_ENABLE_THREADS ON)
set(ENABLE_TESTING OFF)
FetchContent_MakeAvailable(fmt kokkos WFA2lib unordered_dense)
add_subdirectory(src)
#
# LIB_WFA
#
set(LIB_WFA ${LIB_WFA} fast_wfa_lib)
add_library(${LIB_WFA} STATIC)
target_sources(${LIB_WFA}
PUBLIC FILE_SET headers TYPE HEADERS FILES
${WFA_HEADER_FILES}
)
target_sources(${LIB_WFA} PRIVATE ${WFA_SRC_FILES})
if(MSVC)
target_compile_options(${LIB_WFA} PUBLIC /W4 /WX /Zc:preprocessor /Wv:18)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${LIB_WFA} PUBLIC -Werror -W -pedantic -fexperimental-library )
# set_target_properties(${LIB_SYNTH} PROPERTIES CXX_CLANG_TIDY "clang-tidy")
endif()
target_link_libraries(${LIB_WFA} PUBLIC
fmt::fmt
Kokkos::kokkos
unordered_dense::unordered_dense
)
set_property(TARGET ${LIB_WFA} PROPERTY CXX_STANDARD 20)
#
# WFA_TOOL
#
add_executable(wfa_tool "src/wfa_tool.cpp")
set_property(TARGET wfa_tool PROPERTY CXX_STANDARD 20)
target_link_libraries(wfa_tool PRIVATE ${LIB_WFA})
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(wfa_tool PUBLIC -Werror -W -pedantic -fexperimental-library )
# set_target_properties(${LIB_SYNTH} PROPERTIES CXX_CLANG_TIDY "clang-tidy")
endif()
#
# TESTS
#
include(FetchContent)
# Fetch Catch2 library
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.7.1 # Replace with the latest version as needed
)
FetchContent_MakeAvailable(Catch2)
add_subdirectory(tests)
enable_testing()
add_executable(wfa_tests ${WFA_TEST_FILES})
target_link_libraries(wfa_tests PRIVATE Catch2::Catch2 ${LIB_WFA})
add_test(NAME NaiveAlignmentTests COMMAND naive_tests)
#
# WFA2-lib
#
if (LINUX)
add_executable(wfa2_comparison analysis/benchmark.cpp)
target_link_libraries(wfa2_comparison PRIVATE ${LIB_WFA} wfa2::wfa2cpp)
#
# Experiment Executable
#
add_executable(experiment analysis/experiment.cpp)
target_link_libraries(experiment PRIVATE ${LIB_WFA} fmt::fmt wfa2::wfa2cpp)
endif()