-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
62 lines (45 loc) · 1.51 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
cmake_minimum_required(VERSION 3.20.0)
project(vs-nlm-ispc VERSION 0.1 LANGUAGES CXX ISPC)
add_library(vsnlm_ispc SHARED source/vsnlm.cpp source/nlm.ispc)
set_target_properties(vsnlm_ispc 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(vsnlm_ispc PRIVATE ${VS_INCLUDE_DIRS})
install(TARGETS vsnlm_ispc 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(vsnlm_ispc PRIVATE ${VS_INCLUDE_DIR})
install(TARGETS vsnlm_ispc 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-nlm-ispc ${VCS_TAG}")
else()
message(WARNING "unknown plugin version")
set(VCS_TAG "unknown")
endif()
configure_file(source/config.h.in config.h)
target_include_directories(vsnlm_ispc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})