aboutsummaryrefslogtreecommitdiff
path: root/delegate/cmake/Modules/FindFlatbuffers.cmake
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2020-10-19 17:35:30 +0100
committerSadik Armagan <sadik.armagan@arm.com>2020-10-19 16:34:15 +0000
commit3c24f43ff9afb50898d6a73ccddbc0936f72fdad (patch)
treeb4101aab6f085279cddefdc539fb3f622fc8a1b7 /delegate/cmake/Modules/FindFlatbuffers.cmake
parent418c7dd833accc061ba4cba2743631e582962915 (diff)
downloadarmnn-3c24f43ff9afb50898d6a73ccddbc0936f72fdad.tar.gz
IVGCVSW-5365 'Create the TfLite Delegate subdirectory in ArmNN'
* Created delegate sub-directory under armnn * Created Delegate, ArmnnSubgraph and DelegateOptions classes * Created cmake files. * Integrated doctest (under MIT license) as testing framework Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: If725ebd62c40a97c783cdad22bca48709d44338c
Diffstat (limited to 'delegate/cmake/Modules/FindFlatbuffers.cmake')
-rw-r--r--delegate/cmake/Modules/FindFlatbuffers.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/delegate/cmake/Modules/FindFlatbuffers.cmake b/delegate/cmake/Modules/FindFlatbuffers.cmake
new file mode 100644
index 0000000000..13d6f917b3
--- /dev/null
+++ b/delegate/cmake/Modules/FindFlatbuffers.cmake
@@ -0,0 +1,32 @@
+#
+# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+include(FindPackageHandleStandardArgs)
+unset(FLATBUFFERS_FOUND)
+
+find_path(Flatbuffers_INCLUDE_DIR
+ flatbuffers/flatbuffers.h
+ HINTS
+ ${FLATBUFFERS_ROOT}/include
+ /usr/local/include
+ /usr/include)
+
+find_library(Flatbuffers_LIB
+ NAMES
+ libflatbuffers.a
+ flatbuffers
+ HINTS
+ ${FLATBUFFERS_ROOT}/lib
+ /usr/local/lib
+ /usr/lib)
+
+## Set FLATBUFFERS_FOUND
+find_package_handle_standard_args(Flatbuffers DEFAULT_MSG Flatbuffers_INCLUDE_DIR Flatbuffers_LIB)
+
+## Set external variables for usage in CMakeLists.txt
+if(FLATBUFFERS_FOUND)
+ set(Flatbuffers_LIB ${Flatbuffers_LIB})
+ set(Flatbuffers_INCLUDE_DIR ${Flatbuffers_INCLUDE_DIR})
+endif() \ No newline at end of file