-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
151 lines (122 loc) · 5.73 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#Top Dir
cmake_minimum_required(VERSION 3.1)
set (_AV_WARE_VERSION_MAJOR 1)
set (_AV_WARE_VERSION_MINOR 0)
set (_AV_WARE_VERSION_PATCH 5)
set (_AV_WARE_VERSION_OEM Gp)
#baseã€alphaã€beta ã€RC ã€?release(R)
set (_AV_WARE_VERSION_RUNTIME RC)
include (InstallRequiredSystemLibraries)
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set (CPACK_PACKAGE_VERSION_MAJOR "${_AV_WARE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${_AV_WARE_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${_AV_WARE_VERSION_PATCH}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}_${_AV_WARE_VERSION_OEM}")
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}_${_AV_WARE_VERSION_RUNTIME}")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6)")
include (CPack)
if (WIN32)
option (HAVE_CapCamera "use laptop camera for capture " OFF)
option (HAVE_CapScreen "use screen for capture " ON)
option (HAVE_EncIntelGPU "use intel media sdk for encodeing " ON)
option (HAVE_EncFfmpeg "use ffmpeg for encodeing " OFF)
option (HAVE_MemPool "use memory pool for stream buffer " OFF)
option (WITH_UI "Build avWare With Ui On Qt5" OFF)
set (QT_PATH "F:\\ProgramTools\\Qt\\Qt5.5.0\\5.5\\msvc2013")
elseif (UNIX)
option (HAVE_MemPool "use memory pool for stream buffer " OFF)
option (WITH_UI "Build avWare With Ui On Qt5" OFF)
#COMPILER
#set (COMPILER LINUX)
#set (COMPILER AMBA)
set (COMPILER HISI16C)
#set (COMPILER HISI18EV100)
#set (COMPILER HISI18C)
#set (COMPILER HISI18A)
#set (COMPILER HISI16D)
#set (COMPILER HISI16A)
#set (COMPILER HISI3535)
set(CMAKE_SYSTEM_NAME Linux)
if (COMPILER MATCHES "HISI16C" OR COMPILER MATCHES "HISI18EV100" OR COMPILER MATCHES "HISI18C" OR COMPILER MATCHES "HISI18A" )
option (HAVE_SensorInput "use ffmpeg for encodeing " ON)
#set(TOOLCHAIN_DIR "/home/ProgamApp/ToolChain/hisi-linux-nptl/arm-hisiv300-linux/target")
#set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
#set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
#set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-hisiv300-linux-gcc)
#set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-hisiv300-linux-g++)
set (CMAKE_C_COMPILER "arm-hisiv300-linux-gcc")
set (CMAKE_CXX_COMPILER "arm-hisiv300-linux-g++")
elseif (COMPILER MATCHES "HISI16A" OR COMPILER MATCHES "HISI16D")
option (HAVE_HdmiInput "use memory pool for stream buffer " ON)
option (HAVE_SensorInput "use ffmpeg for encodeing " OFF)
set (CMAKE_C_COMPILER "arm-hisiv300-linux-gcc")
set (CMAKE_CXX_COMPILER "arm-hisiv300-linux-g++")
elseif (COMPILER MATCHES "HISI3535")
option (HAVE_HdmiInput "use memory pool for stream buffer " ON)
option (HAVE_SensorInput "use ffmpeg for encodeing " OFF)
set (CMAKE_C_COMPILER "arm-hisiv300-linux-gcc")
set (CMAKE_CXX_COMPILER "arm-hisiv300-linux-g++")
elseif (COMPILER MATCHES "AMBA")
option (HAVE_HdmiInput "use memory pool for stream buffer " OFF)
option (HAVE_SensorInput "use ffmpeg for encodeing " ON)
set (CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc")
set (CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++")
elseif (COMPILER MATCHES "LINUX")
option (HAVE_CapCamera "use laptop camera for capture " OFF)
option (HAVE_CapScreen "use screen for capture " ON)
option (HAVE_EncFfmpeg "use ffmpeg for encodeing " ON)
endif()
endif()
set(CMAKE_SUPPRESS_REGENERATION 1)
set(CMAKE_USE_RELATIVE_PATHS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
#set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
set(PROJDIR ${CMAKE_CURRENT_SOURCE_DIR})
set (AVWARE_HOME_DIR ${PROJDIR})
set (CMAKE_CONFIGURATION_TYPES Debug Release)
set (CMAKE_BUILD_TYPE "Release")
set (CMAKE_BUILD_TYPE "Debug")
project (avWare)
if (WIN32)
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
add_definitions("-D_WINSOCK_DEPRECATED_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /openmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP /openmp")
set(CMAKE_EXE_LINKER_FLAGS "/SAFESEH:NO ")
elseif (UNIX)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if (CMAKE_BUILD_TYPE MATCHES "Release")
message("*****Use Build Type ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s -O2 -pipe -fPIC -Wall -MMD -fno-strict-aliasing -fmessage-length=0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -O2 -pipe -fPIC -Wall -MMD -fno-strict-aliasing -fmessage-length=0")
elseif (CMAKE_BUILD_TYPE MATCHES "Debug")
message("*****Use Build Type ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -ggdb -pipe -fPIC -Wall -MMD -fno-strict-aliasing")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -ggdb -pipe -fPIC -Wall -MMD -fno-strict-aliasing")
if (COMPILER MATCHES LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
endif()
else()
message(FATAL_ERROR "Please use cmake -DCMAKE_BUILD_TYPE=Debug(Release) dir")
endif()
endif()
add_definitions("-D_AV_WARE_")
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
include_directories(${PROJECT_BINARY_DIR})
if (WITH_UI STREQUAL "ON")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
endif()
add_subdirectory(App)