-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
84 lines (65 loc) · 2.88 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
cmake_minimum_required (VERSION 3.14)
# ------------------------------------------------------------------------------#
# MY PERSONAL CONFIG, until i find a better place to put this...
# ------------------------------------------------------------------------------#
set(CMAKE_CXX_COMPILER $ENV{HOME}/GCC-8.4.0/bin/g++)
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
set(IPP_ROOT $ENV{HOME}/intel/ipp CACHE INTERNAL "ipp location hint")
set(VENDOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor CACHE INTERNAL "vendored libaries")
# ------------------------------------------------------------------------------#
# TOP-LEVEL PROJECT
# ------------------------------------------------------------------------------#
project(ZEN LANGUAGES CXX CUDA)
set(VERSION 0.0.1)
include(GNUInstallDirs)
enable_testing()
# ------------------------------------------------------------------------------#
# CONFIGURABLE BUILD OPTIONS
# ------------------------------------------------------------------------------#
option(ENABLE_UBSAN "enable undefined behaviour sanitizer" OFF)
option(ENABLE_ASAN "enable address sanitizer (in place of valgrind)" OFF)
#set(ENV{ASAN_OPTIONS} "protect_shadow_gap=0:replace_intrin=0:detect_leaks=0")
# ------------------------------------------------------------------------------#
# COMMON PREAMBLE
# ------------------------------------------------------------------------------#
set(CUDAToolkit_INCLUDE_DIR ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} CACHE INTERNAL "needed for findcudatoolkit")
set(CMAKE_CXX_STANDARD 14)
add_definitions("-Wall")
add_definitions("-Wextra")
add_definitions("-Wundef")
add_definitions("-Wunreachable-code")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "--default-stream-per-thread")
set(CMAKE_CUDA_FLAGS"-std=c++14 -ggdb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -pthread")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(FindPkgConfig)
# ------------------------------------------------------------------------------#
# SUBPROJECTS
# ------------------------------------------------------------------------------#
add_subdirectory(libzen)
add_subdirectory(zen)
add_subdirectory(demos/pitch-tracking)
add_subdirectory(demos/beat-tracking)
# ------------------------------------------------------------------------------#
# CLANG-FORMAT
# ------------------------------------------------------------------------------#
file(
GLOB_RECURSE
ALL_CXX_SOURCE_FILES
libzen/*.cu
libzen/*.h
libzen/libzen/*.h
zen/*.cu
zen/*.h
demos/pitch-tracking/*.cpp
demos/pitch-tracking/*.cu
demos/pitch-tracking/*.h
demos/beat-tracking/*.cpp
demos/beat-tracking/*.cu
demos/beat-tracking/*.h)
# Adding clang-format target if executable is found
find_program(CLANG_FORMAT "clang-format")
if(CLANG_FORMAT)
add_custom_target(clang-format COMMAND clang-format -i -style=file
${ALL_CXX_SOURCE_FILES})
endif()