-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
73 lines (61 loc) · 2.46 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
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(spdl)
option(SPDL_USE_CUDA "Enable CUDA support" OFF)
option(SPDL_USE_NVCODEC "Enable NVCODEC support" OFF)
option(SPDL_USE_NVJPEG "Enable nvJPEG support" OFF)
option(SPDL_USE_NPPI "Enable NVIDIA 2D Image And Signal Performance Primitives support" OFF)
option(SPDL_LINK_STATIC_NVJPEG "Link nvJPEG and NPPI statically." OFF)
option(SPDL_DEBUG_REFCOUNT "Enable debug print for reference counting of AVFrame objects." OFF)
option(SPDL_HOLD_GIL "Hold GIL in IO functions." OFF)
option(SPDL_BUILD_STUB "Build Python binding stub file" OFF)
option(SPDL_BUILD_PYTHON_BINDING "Build Python binding" ON)
if (SPDL_USE_NVCODEC OR SPDL_USE_NVJPEG)
if (NOT SPDL_USE_CUDA)
unset(SPDL_USE_CUDA CACHE)
set(SPDL_USE_CUDA ON)
endif()
endif()
###############################################################################
# Configurations
###############################################################################
include(./cmake/spdl_common_config.cmake)
include(./cmake/check_cxx_coroutine.cmake)
if (SPDL_USE_CUDA)
if(NOT DEFINED ${CMAKE_CUDA_ARCHITECTURES})
set(CMAKE_CUDA_ARCHITECTURES 75)
endif()
include(./cmake/spdl_cuda_config.cmake)
endif()
###############################################################################
# Build libspdl and binding
###############################################################################
message(STATUS "########################################")
message(STATUS "# Looking for third party dependencies")
message(STATUS "########################################")
find_package(fmt REQUIRED)
find_package(gflags REQUIRED)
find_package(glog REQUIRED)
find_package(libzip REQUIRED)
set(deps fmt::fmt gflags glog::glog libzip::zip)
foreach(dep IN LISTS deps)
get_target_property(location "${dep}" IMPORTED_LOCATION_RELEASE)
message(STATUS "Found ${dep}: ${location}")
endforeach()
add_subdirectory(third_party/ffmpeg/multi)
if (SPDL_USE_TRACING)
add_subdirectory(third_party/perfetto)
endif()
if (SPDL_USE_NVCODEC)
add_subdirectory(third_party/nvcodec)
endif()
if (NOT DEFINED SPDL_PYTHON_BINDING_INSTALL_PREFIX)
set(SPDL_PYTHON_BINDING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
endif ()
add_subdirectory(src)
if (SPDL_BUILD_PYTHON_BINDING)
add_subdirectory(third_party/nanobind)
add_subdirectory(src/spdl/lib)
endif()
message(STATUS "########################################")
message(STATUS "# Configuration done!")
message(STATUS "########################################")