-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
56 lines (43 loc) · 1.48 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
cmake_minimum_required(VERSION 3.9.1)
project(libhevc C CXX)
if(NOT DEFINED SYSTEM_NAME)
set(SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME})
endif()
if(NOT DEFINED SYSTEM_PROCESSOR)
set(SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
if(NOT "${SYSTEM_NAME}" STREQUAL "Darwin")
enable_language(ASM)
endif()
set(HEVC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(HEVC_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
if("${HEVC_ROOT}" STREQUAL "${HEVC_CONFIG_DIR}")
message(
FATAL_ERROR
"Building from within the libhevc source tree is not supported.\n"
"Hint: Run these commands\n"
"$ rm -rf CMakeCache.txt CMakeFiles\n"
"$ mkdir -p ./build\n"
"$ cd ./build\n"
"And re-run CMake from the build directory.")
endif()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
if(${CMAKE_CROSSCOMPILING})
set(THREADS_PTHREAD_ARG
"2"
CACHE STRING
"Refer https://gitlab.kitware.com/cmake/cmake/-/issues/16920" FORCE)
endif()
include("${HEVC_ROOT}/cmake/utils.cmake")
libhevc_add_compile_options()
libhevc_add_definitions()
libhevc_set_link_libraries()
include("${HEVC_ROOT}/common/common.cmake")
include("${HEVC_ROOT}/decoder/libhevcdec.cmake")
include("${HEVC_ROOT}/encoder/libhevcenc.cmake")
include("${HEVC_ROOT}/test/decoder/hevcdec.cmake")
include("${HEVC_ROOT}/test/encoder/hevcenc.cmake")
include("${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cmake")
include("${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cmake")