~ubuntu-branches/ubuntu/wily/libde265/wily

« back to all changes in this revision

Viewing changes to dec265/CMakeLists.txt

  • Committer: Package Import Robot
  • Author(s): Joachim Bauch
  • Date: 2015-07-16 11:07:46 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150716110746-76vsv24j3yux7tnu
Tags: 1.0.2-1
* Imported Upstream version 1.0.2
* Added new files to copyright information.
* Only export decoder API and update symbols for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "Configurations" FORCE)
2
 
 
3
 
if(NOT CMAKE_BUILD_TYPE)
4
 
    # default to Release build for GCC builds
5
 
    set(CMAKE_BUILD_TYPE Release CACHE STRING
6
 
        "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release."
7
 
        FORCE)
8
 
endif()
9
 
 
10
 
project (dec265)
11
 
cmake_minimum_required (VERSION 2.8)
12
 
 
13
 
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../cmake" "${CMAKE_MODULE_PATH}")
14
 
 
15
 
if ("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
16
 
    set(X64 1)
17
 
    add_definitions(-DX86_64)
18
 
endif()
19
 
 
20
 
# Enforce coding standards.  Full warnings and warnings as errors
21
 
if(MSVC)
22
 
    add_definitions(/W4 /D_CRT_SECURE_NO_WARNINGS)
23
 
    add_definitions(/Ob2) # always inline
24
 
    add_definitions(/Oi)  # enable intrinsics
25
 
#    add_definitions(/MP)  # multithreaded build
26
 
#    add_definitions(/TP)  # all files as cpp
27
 
 
28
 
    include_directories(../extra)
29
 
endif(MSVC)
30
 
 
31
 
if("$ENV{CXX}" STREQUAL "icpc")
32
 
    set(GCC 1)
33
 
    add_definitions(-Wall -Wextra -Wunused-variable -Wunused-function -Wshadow -no-vec -msse4)
34
 
elseif(CMAKE_COMPILER_IS_GNUCXX)
35
 
    set(GCC 1)
36
 
    add_definitions(-Wall -Wextra -Wunused-variable -Wunused-function -Wshadow -msse4)
37
 
endif()
38
 
 
39
 
option(USE_ASM "Use SSE41 SIMD optimize" ON)
40
 
if(USE_ASM)
41
 
    add_definitions(-DUSE_ASM=ASM_SSE4)
42
 
    add_definitions(-DHAVE_SSE4_1)
43
 
else(USE_ASM)
44
 
    add_definitions(-DUSE_ASM=ASM_NONE)
45
 
endif(USE_ASM)
46
 
 
47
 
option(USE_VIDEOGFX "Use of VIDEOGFX" OFF)
48
 
if(USE_VIDEOGFX)
49
 
    add_definitions(-D HAVE_VIDEOGFX=1)
50
 
else(USE_VIDEOGFX)
51
 
    add_definitions(-D HAVE_VIDEOGFX=0)
52
 
endif(USE_VIDEOGFX)
53
 
 
54
 
option(BUILD_STATIC  "Static Lib" ON)
55
 
if(BUILD_STATIC)
56
 
    add_definitions(-DLIBDE265_STATIC_BUILD)
57
 
endif(BUILD_STATIC)
58
 
 
59
 
option(DE265_LOG_ERROR  "Enable DE265_LOG_ERROR" OFF)
60
 
if(DE265_LOG_ERROR)
61
 
    add_definitions(-DDE265_LOG_ERROR)
62
 
endif(DE265_LOG_ERROR)
63
 
 
64
 
option(DE265_LOG_INFO   "Enable DE265_LOG_INFO"  OFF)
65
 
if(DE265_LOG_INFO)
66
 
    add_definitions(-DDE265_LOG_INFO)
67
 
endif(DE265_LOG_INFO)
68
 
 
69
 
option(DE265_LOG_DEBUG  "Enable DE265_LOG_DEBUG" OFF)
70
 
if(DE265_LOG_DEBUG)
71
 
    add_definitions(-DDE265_LOG_DEBUG)
72
 
endif(DE265_LOG_DEBUG)
73
 
 
74
 
option(DE265_LOG_TRACE  "Enable DE265_LOG_TRACE" OFF)
75
 
if(DE265_LOG_TRACE)
76
 
    add_definitions(-DDE265_LOG_TRACE)
77
 
endif(DE265_LOG_TRACE)
78
 
 
79
 
include_directories(../ ../libde265)
80
 
 
81
 
file(GLOB LIBSRC ../libde265/*.cc ../extra/*.c)
82
 
file(GLOB LIBINC ../libde265/*.h ../extra/*.h)
83
 
file(GLOB APPSRC dec265.cc)
84
 
file(GLOB ASMSRC0 ../libde265/x86/sse.cc ../libde265/x86/sse-dct.cc)
85
 
file(GLOB ASMSRC1 ../libde265/x86/sse-motion.cc)
86
 
file(GLOB ASMINC ../libde265/x86/*.h)
87
 
 
88
 
source_group(INC  FILES ${LIBINC})
89
 
source_group(SRC  FILES ${LIBSRC})
90
 
source_group(APP  FILES ${APPSRC})
91
 
source_group(ASM  FILES ${ASMSRC0} ${ASMSRC1} ${ASMINC})
92
 
 
93
 
if(USE_ASM)
94
 
    SET(LIBSRC ${LIBSRC} ${ASMSRC0} ${ASMSRC1})
95
 
    SET(LIBINC ${LIBINC} ${ASMINC})
96
 
 
97
 
    # disable uninitialize check on VC, because x1 is not assign, remove later
98
 
    #if(MSVC)
99
 
    #    SET_SOURCE_FILES_PROPERTIES(${ASMSRC1} PROPERTIES COMPILE_FLAGS "/RTCs")
100
 
    #endif(MSVC)
101
 
endif(USE_ASM)
102
 
 
103
 
if(UNIX)
104
 
    SET(PLATFORM_LIBS pthread rt m)
105
 
    SET_SOURCE_FILES_PROPERTIES(../extra/win32thread.c PROPERTIES HEADER_FILE_ONLY TRUE)
106
 
endif(UNIX)
107
 
 
108
 
# Main CLI application
109
 
if(MSVC)
110
 
    add_definitions(/wd4244) # type conversion, possible loss of data
111
 
    add_definitions(/wd4100) # unreferenced formal parameter
112
 
    add_definitions(/wd4505) # unreferenced local function has been removed
113
 
    add_definitions(/wd4701) # potentially uninitialized local variable
114
 
    add_definitions(/wd4127) # conditional expression is constant
115
 
#    add_definitions(/wd4018) # signed/unsigned mismatch
116
 
    add_definitions(/wd4189) # local variable is initialized but not referenced
117
 
    add_definitions(/wd4715) # not all control paths return a value
118
 
    add_definitions(/wd4324) # structure was padded due to __declspec(align())
119
 
 
120
 
    set_source_files_properties(${LIBSRC} PROPERTIES LANGUAGE CXX)
121
 
endif(MSVC)
122
 
if(GCC)
123
 
    add_definitions(-Wno-sign-compare)
124
 
    add_definitions(-Wno-unused-parameter)
125
 
endif(GCC)
126
 
 
127
 
add_executable(dec265
128
 
    ${APPSRC} ${EXTRAS} ${LIBSRC} ${LIBINC}
129
 
)
130
 
 
131
 
target_link_libraries(dec265 ${PLATFORM_LIBS})
132
 
 
 
1
set (dec265_sources
 
2
  dec265.cc
 
3
)
 
4
 
 
5
set (hdrcopy_sources
 
6
  hdrcopy.cc
 
7
)
 
8
 
 
9
if(MSVC)
 
10
  set (dec265_sources
 
11
    ${dec265_sources}
 
12
    ../extra/getopt.c
 
13
    ../extra/getopt_long.c
 
14
  )
 
15
  set (hdrcopy_sources
 
16
    ${hdrcopy_sources}
 
17
    ../extra/getopt.c
 
18
    ../extra/getopt_long.c
 
19
  )
 
20
endif()
 
21
 
 
22
if(SDL_FOUND)
 
23
  add_definitions(-DHAVE_SDL)
 
24
  include_directories ("${SDL_INCLUDE_DIR}")
 
25
  set (dec265_sources
 
26
    ${dec265_sources}
 
27
    sdl.cc
 
28
  )
 
29
endif()
 
30
 
 
31
add_executable (dec265 ${dec265_sources})
 
32
 
 
33
target_link_libraries (dec265 ${LIBDE265_LIBRARY_NAME} ${SDL_LIBRARY})
 
34
 
 
35
 
 
36
if(NOT MSVC)
 
37
  # hdrcopy uses internal APIs that are not available when compiled for Windows
 
38
  add_executable (hdrcopy ${hdrcopy_sources})
 
39
 
 
40
  target_link_libraries (hdrcopy ${LIBDE265_LIBRARY_NAME})
 
41
endif()