[x265] SVTHEVC: Update Findsvthevc.cmake with static lib and 1.4.0 support
Christopher Degawa
ccom at randomderp.com
Mon Aug 19 07:00:00 CEST 2019
# HG changeset patch
# User Christopher Degawa <ccom at randomderp.com>
# Date 1566188835 0
# Mon Aug 19 04:27:15 2019 +0000
# Node ID 6aec140d15c9f00cf07d04b4fa032b084d47fe16
# Parent de920e0a31831f52599f3937c3ee6945e88ed851
SVTHEVC: Update Findsvthevc.cmake with static lib and 1.4.0 support
Added static lib suffixes, removed hardcoding of version to 1.3.0, and
added some default PATHS for the find library and include path for the
headers
to remove reliance on the enviroment variables being set, although it still
does accept them
diff --git a/source/cmake/Findsvthevc.cmake b/source/cmake/Findsvthevc.cmake
--- a/source/cmake/Findsvthevc.cmake
+++ b/source/cmake/Findsvthevc.cmake
@@ -9,20 +9,18 @@
include(FindPackageHandleStandardArgs)
-if(UNIX)
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
-else()
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
-endif()
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.a;.dll;.lib")
set(SVT_VERSION_MAJOR_REQUIRED 1)
set(SVT_VERSION_MINOR_REQUIRED 3)
set(SVT_VERSION_PATCHLEVEL_REQUIRED 0)
+set(SVT_VERSION_REQUIRED
"${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED}")
find_path(SVT_HEVC_INCLUDE_DIR
NAMES EbApi.h EbErrorCodes.h EbTime.h
- HINTS $ENV{SVT_HEVC_INCLUDE_DIR}
- PATHS ENV
+ PATHS /usr/local/include /usr/include
$ENV{SystemDrive}/svt-encoders/include
+ HINTS ENV SVT_HEVC_INCLUDE_DIR
+ PATH_SUFFIXES svt-hevc
DOC "SVT-HEVC include directory")
if(SVT_HEVC_INCLUDE_DIR)
@@ -37,24 +35,24 @@
string(REGEX MATCH "SVT_VERSION_PATCHLEVEL ([0-9]*)" _ ${version})
set(SVT_VERSION_PATCHLEVEL ${CMAKE_MATCH_1})
-if(NOT ${SVT_VERSION_MAJOR} EQUAL "1" OR NOT ${SVT_VERSION_MINOR} EQUAL
"3" OR NOT ${SVT_VERSION_PATCHLEVEL} EQUAL "0")
- message (SEND_ERROR "-- Found SVT-HEVC Lib Version:
${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL} which
doesn't match the required version:
${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED};
Aborting configure ")
+set(SVT_VERSION
"${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL}")
+
+if(${SVT_VERSION} VERSION_LESS ${SVT_VERSION_REQUIRED})
+ message (SEND_ERROR "-- Found SVT-HEVC Lib Version: ${SVT_VERSION}
which doesn't match the required version: ${SVT_VERSION_REQUIRED}; Aborting
configure ")
else()
- message(STATUS "-- Found SVT-HEVC Lib Version:
${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL}")
+ message(STATUS "-- Found SVT-HEVC Lib Version: ${SVT_VERSION}")
endif()
endif()
find_library(SVT_HEVC_LIBRARY
-if(UNIX)
NAMES SvtHevcEnc
-else()
- NAMES SvtHevcEnc
-endif()
- HINTS $ENV{SVT_HEVC_LIBRARY_DIR}
- PATHS ENV
+ PATHS /usr/local/lib /usr/lib /usr/lib64
$ENV{SystemDrive}/svt-encoders/lib $ENV{SystemDrive}/svt-encoders/bin
+ HINTS ENV SVT_HEVC_LIBRARY_DIR
DOC "SVT-HEVC library")
mark_as_advanced(SVT_HEVC_LIBRARY SVT_HEVC_INCLUDE_DIR
SVT_HEVC_LIBRARY_DIR)
-find_package_handle_standard_args(SVTHEVC REQUIRED_VARS SVT_HEVC_LIBRARY
SVT_HEVC_INCLUDE_DIR)
+find_package_handle_standard_args(SVTHEVC
+ REQUIRED_VARS SVT_HEVC_LIBRARY SVT_HEVC_INCLUDE_DIR
+ VERSION_VAR ${SVT_VERSION})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190819/e8d55fc7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svthevcmodule.patch
Type: application/octet-stream
Size: 3223 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190819/e8d55fc7/attachment.obj>
More information about the x265-devel
mailing list