forked from raspberrypi/pico-tflmicro
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists_template.txt
99 lines (82 loc) · 2.41 KB
/
CMakeLists_template.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
cmake_minimum_required(VERSION 3.12)
# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)
project(pico-tflmicro C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
pico_sdk_init()
add_library(pico-tflmicro STATIC)
target_include_directories(pico-tflmicro
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src/
${CMAKE_CURRENT_LIST_DIR}/src/third_party/ruy
${CMAKE_CURRENT_LIST_DIR}/src/third_party/gemmlowp
${CMAKE_CURRENT_LIST_DIR}/src/third_party/kissfft
${CMAKE_CURRENT_LIST_DIR}/src/third_party/flatbuffers
${CMAKE_CURRENT_LIST_DIR}/src/third_party/cmsis/CMSIS/Core/Include
${CMAKE_CURRENT_LIST_DIR}/src/third_party/flatbuffers/include
${CMAKE_CURRENT_LIST_DIR}/src/third_party/cmsis_nn/Include
)
target_compile_definitions(
pico-tflmicro
PUBLIC
COMPILE_DEFINITIONS TF_LITE_DISABLE_X86_NEON=1
COMPILE_DEFINITIONS TF_LITE_STATIC_MEMORY=1
COMPILE_DEFINITIONS TF_LITE_USE_CTIME=1
COMPILE_DEFINITIONS CMSIS_NN=1
COMPILE_DEFINITIONS ARDUINO=1
COMPILE_DEFINITIONS TFLITE_USE_CTIME=1
)
set_target_properties(
pico-tflmicro
PROPERTIES
COMPILE_FLAGS -Os
COMPILE_FLAGS -fno-rtti
COMPILE_FLAGS -fno-exceptions
COMPILE_FLAGS -fno-threadsafe-statics
COMPILE_FLAGS -nostdlib
)
target_link_libraries(
pico-tflmicro
pico_stdlib
pico_multicore
)
target_sources(pico-tflmicro
PRIVATE
{{LIBRARY_SOURCES}}
)
add_library(pico-tflmicro_test STATIC)
target_include_directories(pico-tflmicro_test
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src/
${CMAKE_CURRENT_LIST_DIR}/src/third_party/ruy
${CMAKE_CURRENT_LIST_DIR}/src/third_party/gemmlowp
${CMAKE_CURRENT_LIST_DIR}/src/third_party/kissfft
${CMAKE_CURRENT_LIST_DIR}/src/third_party/flatbuffers
${CMAKE_CURRENT_LIST_DIR}/src/third_party/cmsis/CMSIS/Core/Include
${CMAKE_CURRENT_LIST_DIR}/src/third_party/flatbuffers/include
${CMAKE_CURRENT_LIST_DIR}/src/third_party/cmsis_nn/Include
)
target_compile_definitions(
pico-tflmicro_test
PUBLIC
COMPILE_DEFINITIONS TF_LITE_DISABLE_X86_NEON=1
COMPILE_DEFINITIONS TF_LITE_STATIC_MEMORY=1
COMPILE_DEFINITIONS CMSIS_NN=1
)
set_target_properties(
pico-tflmicro_test
PROPERTIES
COMPILE_FLAGS -fno-rtti
COMPILE_FLAGS -fno-exceptions
COMPILE_FLAGS -fno-threadsafe-statics
COMPILE_FLAGS -nostdlib
)
target_link_libraries(
pico-tflmicro_test
pico_stdlib
pico_multicore
)
add_subdirectory("examples/hello_world")
add_subdirectory("examples/person_detection")
{{TEST_FOLDERS}}