aboutsummaryrefslogtreecommitdiff
path: root/samples/ObjectDetection/cmake/find_armnn.cmake
diff options
context:
space:
mode:
authorÉanna Ó Catháin <eanna.ocathain@arm.com>2020-09-14 17:36:49 +0100
committerJim Flynn <jim.flynn@arm.com>2020-09-14 18:40:01 +0000
commit919c14ef132986aa1514b2070ce6d19b5579a6ab (patch)
tree5c281e02a083768f65871cb861ab9b32ac7d8767 /samples/ObjectDetection/cmake/find_armnn.cmake
parent589e3e81a86c83456580e112978bf7a0ed5f43ac (diff)
downloadarmnn-919c14ef132986aa1514b2070ce6d19b5579a6ab.tar.gz
MLECO-929 Add Object Detection sample application using the public ArmNN C++ API
Change-Id: I14aa1b4b726212cffbefd6687203f93f936fa872 Signed-off-by: Éanna Ó Catháin <eanna.ocathain@arm.com>
Diffstat (limited to 'samples/ObjectDetection/cmake/find_armnn.cmake')
-rw-r--r--samples/ObjectDetection/cmake/find_armnn.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/samples/ObjectDetection/cmake/find_armnn.cmake b/samples/ObjectDetection/cmake/find_armnn.cmake
new file mode 100644
index 0000000000..289e9127f6
--- /dev/null
+++ b/samples/ObjectDetection/cmake/find_armnn.cmake
@@ -0,0 +1,35 @@
+# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+# Search for ArmNN built libraries in user-provided path first, then current repository, then system
+
+set(ARMNN_LIB_NAMES "libarmnn.so"
+ "libarmnnTfLiteParser.so")
+
+set(ARMNN_LIBS "")
+
+get_filename_component(PARENT_DIR ${PROJECT_SOURCE_DIR} DIRECTORY)
+get_filename_component(REPO_DIR ${PARENT_DIR} DIRECTORY)
+
+foreach(armnn_lib ${ARMNN_LIB_NAMES})
+ find_library(ARMNN_${armnn_lib}
+ NAMES
+ ${armnn_lib}
+ HINTS
+ ${ARMNN_LIB_DIR} ${REPO_DIR}
+ PATHS
+ ${ARMNN_LIB_DIR} ${REPO_DIR}
+ PATH_SUFFIXES
+ "lib"
+ "lib64")
+ if(ARMNN_${armnn_lib})
+ message("Found library ${ARMNN_${armnn_lib}}")
+ list(APPEND ARMNN_LIBS ${ARMNN_${armnn_lib}})
+ get_filename_component(LIB_DIR ${ARMNN_${armnn_lib}} DIRECTORY)
+ get_filename_component(LIB_PARENT_DIR ${LIB_DIR} DIRECTORY)
+ set(ARMNN_INCLUDE_DIR ${LIB_PARENT_DIR}/include)
+ endif()
+endforeach()
+
+if(NOT ARMNN_LIBS)
+ message(FATAL_ERROR "Could not find ArmNN libraries ${ARMNN_LIB_NAMES}")
+endif()