-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
71 lines (67 loc) · 2.26 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
cmake_minimum_required(VERSION 3.8)
project(demo C CXX)
include_directories(
"include"
"${TENSORFLOW_SOURCE_DIR}"
"${TENSORFLOW_BUILD_DIR}/abseil-cpp/"
"${TENSORFLOW_BUILD_DIR}/flatbuffers/include"
)
find_library(
${TENSORFLOW_BUILD_DIR} libtensorflow-lite.a
)
set(DEMO_SOURCES "")
list(APPEND DEMO_SOURCES
"src/main.cc"
"src/tokenizer.cc"
)
set(LIB_PATHS "")
list(APPEND LIB_PATHS
"${TENSORFLOW_BUILD_DIR}"
"${TENSORFLOW_BUILD_DIR}/_deps/xnnpack-build"
"${TENSORFLOW_BUILD_DIR}/_deps/ruy-build/ruy"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/status"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/strings"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/flags"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/base"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/crc"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/synchronization"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/debugging"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/time"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/numeric"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/profiling"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/container"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/hash"
"${TENSORFLOW_BUILD_DIR}/_deps/farmhash-build"
"${TENSORFLOW_BUILD_DIR}/_deps/xnnpack-build"
"${TENSORFLOW_BUILD_DIR}/pthreadpool"
"${TENSORFLOW_BUILD_DIR}/_deps/flatbuffers-build"
"${TENSORFLOW_BUILD_DIR}/_deps/cpuinfo-build"
)
set(LIBS "")
foreach(_path IN LISTS LIB_PATHS)
message("Linking: ${_path}")
link_directories(${_path})
file(GLOB TEMP_LIB "${_path}/*.a")
foreach(_lib_path IN LISTS TEMP_LIB)
get_filename_component(_lib_name ${_lib_path} NAME)
list(APPEND LIBS ${_lib_name})
endforeach()
endforeach()
link_directories(
"${TENSORFLOW_BUILD_DIR}/_deps/fft2d-build"
"${TENSORFLOW_BUILD_DIR}/_deps/abseil-cpp-build/absl/status"
)
add_executable(demo ${DEMO_SOURCES})
target_compile_features(demo PRIVATE cxx_std_17)
if(DEFINED ANDROID_ABI)
target_link_libraries(demo
android
log
)
endif()
target_link_libraries(demo
${LIBS}
libtensorflow-lite.a
libfft2d_fftsg2d.a
libfft2d_fftsg.a
)