forked from MPEGGroup/mpeg-pcc-tmc2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·92 lines (79 loc) · 3.82 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
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
PROJECT (TMC2 CXX C )
SET( TMC2_VERSION_MAJOR 10 )
SET( TMC2_VERSION_MINOR 0 )
OPTION( USE_HM_VIDEO_CODEC "Clone, build and use HM video encoder and decoder" TRUE )
OPTION( USE_HDRTOOLS "Clone, build and use HDRTools for color conversions" TRUE )
## CLANG-TIDY CHECK
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_C_COMPILER "/usr/bin/clang")
# set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set( CMAKE_EXPORT_COMPILE_COMMANDS ON)
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/dependencies/cmake")
INCLUDE( CheckCXXCompilerFlag )
CHECK_CXX_COMPILER_FLAG( "-std=c++14" COMPILER_SUPPORTS_CXX14 )
#CHECK_CXX_COMPILER_FLAG( "-std=c++11" COMPILER_SUPPORTS_CXX11 )
#CHECK_CXX_COMPILER_FLAG( "-std=c++0x" COMPILER_SUPPORTS_CXX0X )
if (COMPILER_SUPPORTS_CXX14)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" )
ELSEIF (COMPILER_SUPPORTS_CXX11)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
ELSEIF (COMPILER_SUPPORTS_CXX0X)
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" )
ELSE ()
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()
OPTION( ENABLE_PAPI_PROFILING "Enable PAPI profiling" OFF)
IF( WIN32 OR MSVC OR MSYS OR MINGW OR APPLE )
SET( ENABLE_PAPI_PROFILING OFF )
MESSAGE( "PAPI profiling forced disable for this operating system" )
ENDIF()
IF( ENABLE_PAPI_PROFILING )
MESSAGE( "PAPI profiling enable (ENABLE_PAPI_PROFILING = " ${ENABLE_PAPI_PROFILING} " ).")
IF( NOT IS_DIRECTORY "${CMAKE_SOURCE_DIR}/dependencies/papi/" )
EXECUTE_PROCESS( COMMAND git clone https://bitbucket.org/icl/papi.git ${CMAKE_SOURCE_DIR}/dependencies/papi/; )
ENDIF()
IF ( NOT EXISTS ${CMAKE_SOURCE_DIR}/dependencies/papi/src/libpapi.a )
EXECUTE_PROCESS( COMMAND ./configure WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/papi/src/ )
EXECUTE_PROCESS( COMMAND make -j4 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/papi/src/ )
ENDIF()
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_SOURCE_DIR}/dependencies/papi/src/ " )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SOURCE_DIR}/dependencies/papi/src/libpapi.a ")
ENDIF()
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-implicit -Wno-sign-compare -Wall -Wformat=0" )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin )
IF (MSVC)
ADD_DEFINITIONS("/wd4244 /wd4267 /wd4996")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:tbb_debug.lib")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:tbb.lib")
ENDIF()
# INCLUDE USE_HM_VIDEO_CODEC
IF( USE_HM_VIDEO_CODEC )
INCLUDE( ${CMAKE_SOURCE_DIR}/dependencies/cmake/hm.cmake )
ENDIF()
if ( USE_HDRTOOLS )
INCLUDE( ${CMAKE_SOURCE_DIR}/dependencies/cmake/hdrtools.cmake )
ENDIF()
## CLANG FORMAT
INCLUDE( dependencies/cmake/clang.cmake )
ADD_SUBDIRECTORY(dependencies)
ADD_SUBDIRECTORY(source/lib/PccLibVideoDecoder)
ADD_SUBDIRECTORY(source/lib/PccLibVideoEncoder)
ADD_SUBDIRECTORY(source/lib/PccLibColorConverter)
ADD_SUBDIRECTORY(source/lib/PccLibBitstreamCommon)
ADD_SUBDIRECTORY(source/lib/PccLibBitstreamWriter)
ADD_SUBDIRECTORY(source/lib/PccLibBitstreamReader)
ADD_SUBDIRECTORY(source/lib/PccLibCommon)
ADD_SUBDIRECTORY(source/lib/PccLibDecoder)
ADD_SUBDIRECTORY(source/lib/PccLibEncoder)
ADD_SUBDIRECTORY(source/lib/PccLibMetrics)
ADD_SUBDIRECTORY(source/app/PccAppParser)
ADD_SUBDIRECTORY(source/app/PccAppEncoder)
ADD_SUBDIRECTORY(source/app/PccAppDecoder)
ADD_SUBDIRECTORY(source/app/PccAppMetrics)
ADD_SUBDIRECTORY(source/app/PccAppHMVideoEncoder)
ADD_SUBDIRECTORY(source/app/PccAppHMVideoDecoder)
ADD_SUBDIRECTORY(source/app/PccAppColorConverter)