This repository was archived by the owner on May 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
81 lines (74 loc) · 2.62 KB
/
CMakeLists.txt
File metadata and controls
81 lines (74 loc) · 2.62 KB
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
cmake_minimum_required (VERSION 2.8)
Project(smart_city NONE)
if (NOT DEFINED REGISTRY)
set(REGISTRY "")
elseif (NOT ${REGISTRY} MATCHES "/$")
set(REGISTRY "${REGISTRY}/")
endif()
if (NOT DEFINED RELEASE)
set(RELEASE ":latest")
elseif (NOT ${RELEASE} MATCHES "^:")
set(RELEASE ":${RELEASE}")
endif()
if (NOT DEFINED PLATFORM)
set(PLATFORM "Xeon")
endif()
set(FRAMEWORK "gst")
if (NOT DEFINED SCENARIO)
set(SCENARIO "traffic")
endif()
if (NOT DEFINED NOFFICES)
set(NOFFICES "1")
endif()
if (NOT DEFINED NCAMERAS)
set(NCAMERAS "5")
endif()
if (NOT DEFINED NANALYTICS)
if(SCENARIO MATCHES "stadium")
set(NANALYTICS "1,0,1")
else()
set(NANALYTICS "1")
endif()
endif()
if (NOT DEFINED NETWORK)
if(PLATFORM STREQUAL "Xeon")
set(NETWORK "INT8,FP32")
endif()
endif()
if(PLATFORM STREQUAL "Xeon")
if((NOT (NETWORK MATCHES "FP32")) AND (NOT (NETWORK MATCHES "INT8")))
if(NOT (NETWORK MATCHES "FP32"))
set(NETWORK "FP32,${NETWORK}")
endif()
if(NOT (NETWORK MATCHES "INT8"))
set(NETWORK "INT8,${NETWORK}")
endif()
endif()
if(NETWORK MATCHES "FP16")
string(REGEX REPLACE "FP16,*" "" NETWORK ${NETWORK})
endif()
endif()
string(REGEX REPLACE ",$" "" NETWORK ${NETWORK})
if(NOT REGISTRY)
add_custom_target(update ${CMAKE_HOME_DIRECTORY}/script/update-image.sh)
else()
add_custom_target(update)
endif()
file(GLOB dirs "deployment" "*")
list(REMOVE_DUPLICATES dirs)
foreach (dir ${dirs})
if(EXISTS ${dir}/CMakeLists.txt)
add_subdirectory(${dir})
endif()
endforeach()
# legal message
execute_process(COMMAND printf "\n\nThis script will build third party components licensed under various open source licenses into your container images. The terms under which those components may be used and distributed can be found with the license document that is provided with those components. Please familiarize yourself with those terms to ensure your distribution of those components complies with the terms of those licenses.\n\n")
execute_process(COMMAND printf "\n")
execute_process(COMMAND printf "-- Setting: PLATFORM=${PLATFORM}\n")
execute_process(COMMAND printf "-- Setting: REGISTRY=${REGISTRY}\n")
execute_process(COMMAND printf "-- Setting: RELEASE=${RELEASE}\n")
execute_process(COMMAND printf "-- Setting: SCENARIO=${SCENARIO}\n")
execute_process(COMMAND printf "-- Setting: NOFFICES=${NOFFICES}\n")
execute_process(COMMAND printf "-- Setting: NCAMERAS=${NCAMERAS}\n")
execute_process(COMMAND printf "-- Setting: NANALYTICS=${NANALYTICS}\n")
execute_process(COMMAND printf "-- Setting: NETWORK=${NETWORK}\n")