-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
94 lines (78 loc) · 2.42 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
cmake_minimum_required(VERSION 3.28)
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
project(RIFE)
find_package(Boost 1.80 REQUIRED COMPONENTS filesystem)
option(NCNN_INSTALL_SDK "" OFF)
option(NCNN_PIXEL_ROTATE "" OFF)
option(NCNN_PIXEL_AFFINE "" OFF)
option(NCNN_PIXEL_DRAWING "" OFF)
option(NCNN_VULKAN "" ON)
option(NCNN_BUILD_BENCHMARK "" OFF)
option(NCNN_BUILD_TESTS "" OFF)
option(NCNN_BUILD_TOOLS "" OFF)
option(NCNN_BUILD_EXAMPLES "" OFF)
option(NCNN_SIMPLEVK "" OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ncnn)
set(sources
${CMAKE_CURRENT_SOURCE_DIR}/src/plugin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rife.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/warp.cpp
)
if (WIN32)
set(sources
${sources}
${CMAKE_CURRENT_SOURCE_DIR}/src/rife.rc
)
endif()
add_library(RIFE SHARED ${sources})
target_include_directories(RIFE PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${Boost_INCLUDE_DIRS}
)
target_link_libraries(RIFE PRIVATE
Boost::filesystem
ncnn
avisynth
)
target_compile_features(RIFE PRIVATE cxx_std_20)
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
if (build_type STREQUAL debug)
target_compile_definitions(RIFE PRIVATE DEBUG_BUILD)
else (build_type STREQUAL release)
target_compile_definitions(RIFE PRIVATE RELEASE_BUILD)
endif()
message(STATUS "Build type - ${CMAKE_BUILD_TYPE}")
else()
target_compile_options(RIFE PRIVATE "/EHsc")
endif()
if (WIN32)
set_target_properties(RIFE PROPERTIES
PREFIX ""
OUTPUT_NAME "RIFE"
)
else()
find_package(Git)
if (GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
OUTPUT_VARIABLE ver
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set_target_properties(RIFE PROPERTIES OUTPUT_NAME "rife.${ver}")
endif()
include(GNUInstallDirs)
INSTALL(TARGETS RIFE LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/avisynth")
# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
endif()