-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
81 lines (69 loc) · 2.51 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
cmake_minimum_required(VERSION 3.12)
project(loop-tempo-estimator)
# Option to build tests:
option(BUILD_TESTS "Build tests" ON)
option(BUILD_VAMP_PLUGIN "Build Vamp plugin" ON)
set(CMAKE_CXX_STANDARD 17)
if (MSVC)
# Fix crash on older runtimes: https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
# Suppress specific MSVC warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_compile_options(
/wd4244 # Conversion from 'type1' to 'type2', possible loss of data
/wd4267 # Conversion from 'size_t' to 'type', possible loss of data
/wd4101 # Unreferenced local variable
/wd4018 # Signed/unsigned mismatch
/wd4305 # Truncation from 'type1' to 'type2'
)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Suppress equivalent GCC/Clang warnings
add_compile_options(
-D_CRT_SECURE_NO_WARNINGS # Define macro (harmless on non-MSVC compilers)
-Wno-conversion # Suppress warnings about conversions
-Wno-sign-conversion # Suppress sign conversion warnings
-Wno-unused-variable # Suppress unused variable warnings
-Wno-sign-compare # Suppress signed/unsigned comparison warnings
-Wno-float-conversion # Suppress float conversion warnings
)
endif()
include(pffft.cmake)
set(SOURCES
include/LoopTempoEstimator/LoopTempoEstimator.h
include/LoopTempoEstimator/LteTypes.h
source/DecimatingLteAudioReader.cpp
source/DecimatingLteAudioReader.h
source/GetMeterUsingTatumQuantizationFit.cpp
source/GetMeterUsingTatumQuantizationFit.h
source/IteratorX.cpp
source/IteratorX.h
source/LoopTempoEstimator.cpp
source/LteDsp.cpp
source/LteDsp.h
source/LteUtils.cpp
source/LteUtils.h
source/MapToPositiveHalfIndex.h
source/MathApprox.h
source/PowerSpectrumGetter.cpp
source/PowerSpectrumGetter.h
source/StftFrameProvider.cpp
source/StftFrameProvider.h
)
# Create the executable
add_library(loop-tempo-estimator ${SOURCES})
# Link libraries
target_link_libraries(loop-tempo-estimator PUBLIC pffft)
set_target_properties(loop-tempo-estimator PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(loop-tempo-estimator
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/source
)
if (BUILD_TESTS)
add_subdirectory(tests)
endif()
if (BUILD_VAMP_PLUGIN)
include(vamp-plugin-sdk.cmake)
add_subdirectory(vamp-plugin)
endif()