-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
83 lines (60 loc) · 2.23 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
cmake_minimum_required(VERSION 3.22.0)
project(vs-wnnm VERSION 0.1 LANGUAGES CXX)
set(VCL_HOME "" CACHE PATH "Path to vector class v2 headers")
set(ARMPL_HOME "" CACHE PATH "Path to Arm Performance Libraries")
add_library(wnnm SHARED source/wnnm.cpp)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
find_package(MKL CONFIG REQUIRED)
target_include_directories(wnnm PRIVATE ${VCL_HOME})
target_link_libraries(wnnm PRIVATE $<LINK_ONLY:MKL::MKL>)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*|armv8.*)")
cmake_path(APPEND TEMP_PATH "${ARMPL_HOME}" "include")
target_include_directories(wnnm PRIVATE "${TEMP_PATH}")
cmake_path(APPEND TEMP_PATH "${ARMPL_HOME}" "lib")
target_link_directories(wnnm PRIVATE "${TEMP_PATH}")
target_link_libraries(wnnm PRIVATE armpl_lp64)
else()
message(SEND_ERROR "unknown target: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set_target_properties(wnnm PROPERTIES
CXX_EXTENSIONS OFF
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
find_package(PkgConfig QUIET MODULE)
if(PKG_CONFIG_FOUND)
pkg_search_module(VS vapoursynth)
if(VS_FOUND)
message(STATUS "Found VapourSynth r${VS_VERSION}")
cmake_path(APPEND install_dir ${VS_LIBDIR} vapoursynth)
target_include_directories(wnnm PRIVATE ${VS_INCLUDE_DIRS})
install(TARGETS wnnm LIBRARY DESTINATION ${install_dir})
endif()
endif()
if(NOT VS_FOUND)
set(VS_INCLUDE_DIR "" CACHE PATH "Path to VapourSynth headers")
if(VS_INCLUDE_DIR STREQUAL "")
message(WARNING "VapourSynth not found")
endif()
target_include_directories(wnnm PRIVATE ${VS_INCLUDE_DIR})
install(TARGETS wnnm LIBRARY RUNTIME)
endif()
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --long --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE VCS_TAG
)
if(VCS_TAG)
string(STRIP ${VCS_TAG} VCS_TAG)
endif()
endif()
if(VCS_TAG)
message(STATUS "vs-wnnm ${VCS_TAG}")
else()
message(WARNING "unknown plugin version")
set(VCS_TAG "unknown")
endif()
configure_file(source/config.h.in config.h)
target_include_directories(wnnm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})