-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
92 lines (70 loc) · 2.15 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
cmake_minimum_required(VERSION 3.21)
# This CMake file is adapted from https://github.com/cpp-best-practices/cmake_template
# This template attempts to be "fetch_content"-able
# so that it works well with tools like CPM or other
# manual dependency management
project(DTWC++ VERSION "1.0.0"
DESCRIPTION "A C++ library for fast Dynamic Time Wrapping Clustering"
HOMEPAGE_URL https://battery-intelligence-lab.github.io/dtw-cpp/
LANGUAGES CXX C)
# Define the root path
add_definitions(-DDTWC_ROOT_FOLDER="${CMAKE_SOURCE_DIR}")
include(cmake/StandardProjectSettings.cmake)
option(DTWC_BUILD_EXAMPLES OFF)
option(DTWC_BUILD_TESTING OFF)
option(BUILD_BENCHMARK OFF)
set(DTWC_ENABLE_GUROBI ON)
set(DTWC_ENABLE_HIGHS ON)
include(cmake/Dependencies.cmake) # Include external projects
include(cmake/FindGUROBI.cmake)
include(cmake/PreventInSourceBuilds.cmake)
dtwc_setup_dependencies()
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
# Link this 'library' to set the c++ standard / compile-time options requested
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_17)
enable_testing()
add_subdirectory(dtwc bin)
add_executable(dtwc_main
dtwc/main.cpp
)
target_link_libraries(dtwc_main
PRIVATE
dtwc++
project_warnings
project_options
armadillo
)
add_executable(dtwc_cl
dtwc/dtwc_cl.cpp
)
target_link_libraries(dtwc_cl
PRIVATE
dtwc++
CLI11::CLI11
project_warnings
project_options
)
# Adding the tests:
include(CTest)
enable_testing()
if(DTWC_BUILD_TESTING)
#message(AUTHOR_WARNING "Building Tests. Be sure to check out test/constexpr_tests.cpp for constexpr testing")
include(cmake/Coverage.cmake)
add_subdirectory(tests)
endif()
if(DTWC_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif()
find_package(pybind11 QUIET)
if(pybind11_FOUND)
pybind11_add_module(dtwcpp
python/py_main.cpp)
target_link_libraries(dtwcpp PRIVATE dtwc++ project_warnings project_options armadillo)
else()
message(STATUS "pybind11 not found. Skipping the dtwcpp module.")
endif()