forked from chikuzen/MPEG2DecPlus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
67 lines (54 loc) · 1.87 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
cmake_minimum_required(VERSION 3.16)
project(libd2vsource LANGUAGES CXX)
find_package (Git)
if (GIT_FOUND)
execute_process (COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
OUTPUT_VARIABLE ver
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else ()
message (STATUS "GIT not found")
endif ()
add_library(d2vsource SHARED
src/AVISynthAPI.cpp
src/color_convert.cpp
src/getbit.cpp
src/gethdr.cpp
src/getpic.cpp
src/global.cpp
src/idct_ap922_sse2.cpp
src/idct_llm_float_avx2.cpp
src/idct_llm_float_sse2.cpp
src/idct_ref_sse3.cpp
src/mc.cpp
src/misc.cpp
src/MPEG2Decoder.cpp
src/store.cpp
src/yv12pict.cpp
)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
message(STATUS "Build type - ${CMAKE_BUILD_TYPE}")
set_source_files_properties(src/idct_ap922_sse2.cpp PROPERTIES COMPILE_OPTIONS "-mfpmath=sse;-msse2")
set_source_files_properties(src/idct_llm_float_sse2.cpp PROPERTIES COMPILE_OPTIONS "-mfpmath=sse;-msse2")
set_source_files_properties(src/idct_ref_sse3.cpp PROPERTIES COMPILE_OPTIONS "-mssse3")
set_source_files_properties(src/idct_llm_float_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma")
target_include_directories(d2vsource PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
/usr/local/include/avisynth
)
set_target_properties(d2vsource PROPERTIES OUTPUT_NAME "d2vsource.${ver}")
target_compile_features(d2vsource PRIVATE cxx_std_17)
include(GNUInstallDirs)
INSTALL(TARGETS d2vsource
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/avisynth")
# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_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()