blob: 081b3f32a04616be17d3d65d7f3e6c2d2d6cd360 [file] [log] [blame]
Sadik Armagan3c24f432020-10-19 17:35:30 +01001#
Ryan OSheab5540542022-07-06 09:52:52 +01002# Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved.
Sadik Armagan3c24f432020-10-19 17:35:30 +01003# SPDX-License-Identifier: MIT
4#
5
Jan Eilersb968a4f2020-11-15 14:44:43 +00006cmake_minimum_required (VERSION 3.7.0)
Sadik Armagan3c24f432020-10-19 17:35:30 +01007project(armnnDelegate)
Ryan OShea238ecd92023-03-07 11:44:23 +00008set(CMAKE_CXX_STANDARD 17)
9set(CMAKE_CXX_STANDARD_REQUIRED ON)
Ryan OShea238ecd92023-03-07 11:44:23 +000010set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -Wno-comment")
Finn Williamsbbbefec2020-11-25 14:32:42 +000011set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/")
Sadik Armagan3c24f432020-10-19 17:35:30 +010012
Teresa Charlinad1b3d72023-03-14 12:10:28 +000013option(BUILD_UNIT_TESTS "Build unit tests" ON)
14option(BUILD_CLASSIC_DELEGATE "Build classic delegate" ON)
15option(BUILD_OPAQUE_DELEGATE "Build opaque delegate" OFF)
16option(BUILD_SHARED_LIBS "Build share libs" ON)
17option(BUILD_DELEGATE_JNI_INTERFACE "Builds a library to allow accessing the Arm NN delegate from Java code.
18 This is an experimental feature." ON)
19
Sadik Armagan3c24f432020-10-19 17:35:30 +010020set(armnnDelegate_sources)
21list(APPEND armnnDelegate_sources
Teresa Charlinad1b3d72023-03-14 12:10:28 +000022 common/include/DelegateOptions.hpp
23 common/src/DelegateOptions.cpp
David Monahan6c53f9f2023-04-27 15:21:19 +010024 common/src/DelegateUtils.hpp
25 common/src/MultiLayerFacade.hpp)
Sadik Armagan3c24f432020-10-19 17:35:30 +010026
27## Add Armnn as a Dependency
Finn Williamsbbbefec2020-11-25 14:32:42 +000028if(NOT ARMNN_SUB_PROJECT)
29 find_package(Armnn REQUIRED CONFIG HINTS ${Armnn_DIR})
30endif()
Teresa Charlinad1b3d72023-03-14 12:10:28 +000031
32if (BUILD_CLASSIC_DELEGATE)
33 add_subdirectory(classic)
34 add_library(armnnDelegate ${armnnDelegate_sources})
35
36 target_include_directories(armnnDelegate
37 PUBLIC
38 $<INSTALL_INTERFACE:include>
39 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include>
40 PRIVATE
41 ${CMAKE_CURRENT_SOURCE_DIR}/common/src)
42endif()
43if (BUILD_OPAQUE_DELEGATE)
44 add_subdirectory(opaque)
45 add_library(armnnOpaqueDelegate ${armnnDelegate_sources})
46
47 target_include_directories(armnnOpaqueDelegate
48 PUBLIC
49 $<INSTALL_INTERFACE:include>
50 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include>
51 PRIVATE
52 ${CMAKE_CURRENT_SOURCE_DIR}/common/src)
53endif()
54
55include(GNUInstallDirs)
56
57if (BUILD_CLASSIC_DELEGATE)
58 target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn)
59
60 ## Add armnnClassicDelegateObject as a Dependency
61 target_link_libraries(armnnDelegate PUBLIC armnnClassicDelegateObject)
62endif()
63if (BUILD_OPAQUE_DELEGATE)
64 target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::Armnn)
65
66 ## Add armnnOpaqueDelegateObject as a Dependency
67 target_link_libraries(armnnOpaqueDelegate PUBLIC armnnOpaqueDelegateObject)
68endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +010069
Keith Davis9a701c82021-09-28 16:43:24 +010070## Add TfLite dependency
Jim Flynnfca233e2021-09-23 12:16:53 +010071find_package(TfLiteSrc REQUIRED MODULE)
Sadik Armagan3c24f432020-10-19 17:35:30 +010072find_package(TfLite REQUIRED MODULE)
Teresa Charlinad1b3d72023-03-14 12:10:28 +000073if (BUILD_CLASSIC_DELEGATE)
74 target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB})
Sadik Armagan3c24f432020-10-19 17:35:30 +010075
Teresa Charlinad1b3d72023-03-14 12:10:28 +000076 # lpthread and ldl are not required for Android
77 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android)
78 target_link_libraries(armnnDelegate PUBLIC -lpthread)
79 target_link_libraries(armnnDelegate PUBLIC -ldl)
80 endif()
Keith Davisd62eef92021-09-20 18:17:33 +010081endif()
Teresa Charlinad1b3d72023-03-14 12:10:28 +000082if (BUILD_OPAQUE_DELEGATE)
83 target_link_libraries(armnnOpaqueDelegate PUBLIC ${TfLite_LIB})
Keith Davisd62eef92021-09-20 18:17:33 +010084
Teresa Charlinad1b3d72023-03-14 12:10:28 +000085 # lpthread and ldl are not required for Android
86 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android)
87 target_link_libraries(armnnOpaqueDelegate PUBLIC -lpthread)
88 target_link_libraries(armnnOpaqueDelegate PUBLIC -ldl)
89 endif()
90endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +010091
Narumol Prangnawarat4cf0fe32020-12-18 16:13:06 +000092# Add libraries from armnn third-party libraries
93# Third-party header files are not warning clean
94# We can't change compilation flags on header files directly, so we need to add them to an interface library first
95add_library(thirdparty_headers INTERFACE)
96target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/third-party>
97 $<INSTALL_INTERFACE:include/thirdparty_headers>)
98
99target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000100if (BUILD_CLASSIC_DELEGATE)
101 target_link_libraries(armnnDelegate PUBLIC thirdparty_headers)
102endif()
103if (BUILD_OPAQUE_DELEGATE)
104 target_link_libraries(armnnOpaqueDelegate PUBLIC thirdparty_headers)
105endif()
Narumol Prangnawarat4cf0fe32020-12-18 16:13:06 +0000106
Jim Flynnfca233e2021-09-23 12:16:53 +0100107add_library(profiling_library_headers INTERFACE)
108target_include_directories(profiling_library_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/profiling>
109 $<INSTALL_INTERFACE:include/profiling_library_headers>)
Jim Flynnfca233e2021-09-23 12:16:53 +0100110
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000111if (BUILD_CLASSIC_DELEGATE)
112 target_link_libraries(armnnDelegate PUBLIC profiling_library_headers)
113 target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils)
Matthew Sloyanac001ee2021-02-03 10:43:04 +0000114
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000115 set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION})
116endif()
117if (BUILD_OPAQUE_DELEGATE)
118 target_link_libraries(armnnOpaqueDelegate PUBLIC profiling_library_headers)
119 target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::armnnUtils)
120
121 set_target_properties(armnnOpaqueDelegate PROPERTIES VERSION ${OPAQUE_DELEGATE_LIB_VERSION} SOVERSION ${OPAQUE_DELEGATE_LIB_SOVERSION})
122endif()
123
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100124if(BUILD_UNIT_TESTS)
125 set(commonDelegate_unittest_sources)
126 list(APPEND commonDelegate_unittest_sources
127 common/src/test/DelegateTestInterpreter.hpp
128 common/src/test/DelegateTestInterpreterUtils.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000129 test/ActivationTest.cpp
130 test/ActivationTestHelper.hpp
131 test/ArgMinMaxTest.cpp
132 test/ArgMinMaxTestHelper.hpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000133 test/BatchMatMulTest.cpp
134 test/BatchMatMulTestHelper.hpp
135 test/BatchSpaceTest.cpp
136 test/BatchSpaceTestHelper.hpp
137 test/CastTest.cpp
138 test/CastTestHelper.hpp
139 test/ComparisonTest.cpp
140 test/ComparisonTestHelper.hpp
141 test/ControlTest.cpp
142 test/ControlTestHelper.hpp
143 test/Convolution2dTest.cpp
144 test/Convolution3dTest.cpp
145 test/ConvolutionTestHelper.hpp
146 test/DelegateOptionsTest.cpp
147 test/DelegateOptionsTestHelper.hpp
148 test/DepthwiseConvolution2dTest.cpp
149 test/ElementwiseBinaryTest.cpp
150 test/ElementwiseBinaryTestHelper.hpp
151 test/ElementwiseUnaryTest.cpp
152 test/ElementwiseUnaryTestHelper.hpp
153 test/FillTest.cpp
154 test/FillTestHelper.hpp
155 test/FullyConnectedTest.cpp
156 test/FullyConnectedTestHelper.hpp
157 test/GatherTest.cpp
158 test/GatherTestHelper.hpp
159 test/GatherNdTest.cpp
160 test/GatherNdTestHelper.hpp
161 test/LogicalTest.cpp
162 test/LogicalTestHelper.hpp
163 test/LstmTest.cpp
164 test/LstmTestHelper.hpp
165 test/MirrorPadTest.cpp
166 test/NormalizationTest.cpp
167 test/NormalizationTestHelper.hpp
168 test/PackTest.cpp
169 test/PackTestHelper.hpp
170 test/PadTest.cpp
171 test/PadTestHelper.hpp
172 test/Pooling2dTest.cpp
173 test/Pooling2dTestHelper.hpp
174 test/Pooling3dTest.cpp
175 test/Pooling3dTestHelper.hpp
176 test/PreluTest.cpp
177 test/PreluTestHelper.hpp
178 test/QuantizationTest.cpp
179 test/QuantizationTestHelper.hpp
180 test/RedefineTestHelper.hpp
181 test/ReduceTest.cpp
182 test/ReduceTestHelper.hpp
183 test/ReshapeTest.cpp
184 test/ResizeTest.cpp
185 test/ResizeTestHelper.hpp
186 test/RoundTest.cpp
187 test/RoundTestHelper.hpp
188 test/SoftmaxTest.cpp
189 test/SoftmaxTestHelper.hpp
190 test/SpaceDepthTest.cpp
191 test/SpaceDepthTestHelper.hpp
192 test/ShapeTest.cpp
193 test/ShapeTestHelper.hpp
194 test/SliceTest.cpp
195 test/SliceTestHelper.hpp
196 test/StridedSliceTest.cpp
197 test/StridedSliceTestHelper.hpp
198 test/SplitTest.cpp
199 test/SplitTestHelper.hpp
200 test/TestUtils.hpp
201 test/TestUtils.cpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100202 test/TransposeConvolution2dTest.cpp
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000203 test/TransposeTest.cpp
204 test/TransposeTestHelper.hpp
205 test/UnidirectionalSequenceLstmTest.cpp
206 test/UnidirectionalSequenceLstmTestHelper.hpp
207 test/UnpackTest.cpp
208 test/UnpackTestHelper.hpp)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100209
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100210 # There's a known Android NDK bug which causes a subset of NeonLayerTests to
211 # fail. We'll exclude these tests in NeonLayerTests_NDK_Bug.cpp if we're doing
212 # a debug build and NDK is less than r21.
213 # https://github.com/android/ndk/issues/1135
Keith Davis7c67fab2021-04-08 11:47:23 +0100214
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100215 # Default to always including these tests.
216 set(INCLUDE_NDK_BUG_TESTS "ON")
217 # Reconsider if we in a debug build.
218 string( TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_LOWERCASE )
219 if ( NOT BUILD_TYPE_LOWERCASE STREQUAL "release" )
220 message("CMAKE:: BUILD TYPE IS ${CMAKE_BUILD_TYPE}")
221 # And NDK_VERSION has been set.
222 if ( DEFINED NDK_VERSION )
223 message("CMAKE:: NDK DEFINED")
224 # And the version is less than r21.
225 if ( ${NDK_VERSION} STRLESS "r21" )
226 message("CMAKE:: BUG TESTS OFF")
227 set(INCLUDE_NDK_BUG_TESTS "OFF")
Keith Davis7c67fab2021-04-08 11:47:23 +0100228 endif()
229 endif()
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100230 endif()
Keith Davis7c67fab2021-04-08 11:47:23 +0100231
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100232 if ( INCLUDE_NDK_BUG_TESTS STREQUAL "ON" )
233 list(APPEND commonDelegate_unittest_sources
234 test/NeonDelegateTests_NDK_Issue.cpp)
235 endif()
Keith Davis7c67fab2021-04-08 11:47:23 +0100236
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100237 if (BUILD_CLASSIC_DELEGATE)
238 set(classicDelegate_unittest_sources)
239 list(APPEND classicDelegate_unittest_sources
240 classic/src/test/ArmnnClassicDelegateTest.cpp
241 classic/src/test/DelegateTestInterpreter.cpp)
242
243 add_executable(DelegateUnitTests ${commonDelegate_unittest_sources} ${classicDelegate_unittest_sources})
Keith Davis7c67fab2021-04-08 11:47:23 +0100244
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000245 target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
Matthew Sloyanebe392d2023-03-30 10:12:08 +0100246 target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test")
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100247 target_include_directories(DelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR})
Sadik Armagan3c24f432020-10-19 17:35:30 +0100248
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000249 # Add half library from armnn third-party libraries
250 target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers)
Ryan OSheaac9607f2023-04-03 11:33:33 +0100251 target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000252 target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils)
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000253 target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers)
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100254 endif()
255
256 if (BUILD_OPAQUE_DELEGATE)
257 set(opaqueDelegate_unittest_sources)
258 list(APPEND opaqueDelegate_unittest_sources
259 common/src/test/DelegateTestInterpreter.hpp
260 common/src/test/DelegateTestInterpreterUtils.hpp
261 opaque/src/test/ArmnnOpaqueDelegateTest.cpp
262 opaque/src/test/DelegateTestInterpreter.cpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +0100263 test/ActivationTest.cpp
264 test/ActivationTestHelper.hpp
John Mcloughlin559d9092023-04-26 20:14:47 +0100265 test/ArgMinMaxTest.cpp
266 test/ArgMinMaxTestHelper.hpp
John Mcloughlin0422cf22023-04-27 16:55:00 +0100267 test/BatchMatMulTest.cpp
268 test/BatchMatMulTestHelper.hpp
Kevin May81b66f32023-04-26 14:55:36 +0100269 test/BatchSpaceTest.cpp
270 test/BatchSpaceTestHelper.hpp
Ryan OSheaa37ccb02023-04-11 10:54:07 +0100271 test/CastTest.cpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100272 test/CastTestHelper.hpp
Matthew Sloyan2b04ec32023-04-26 11:42:46 +0100273 test/ComparisonTest.cpp
274 test/ComparisonTestHelper.hpp
275 test/ControlTest.cpp
276 test/ControlTestHelper.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100277 test/Convolution2dTest.cpp
Francis Murtagh3a9e7ba2023-04-26 15:58:39 +0100278 test/Convolution3dTest.cpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100279 test/ConvolutionTestHelper.hpp
280 test/DepthwiseConvolution2dTest.cpp
Teresa Charlinf69ae562023-04-27 14:42:23 +0100281 test/ElementwiseUnaryTestHelper.hpp
282 test/ElementwiseUnaryTest.cpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +0100283 test/FullyConnectedTest.cpp
284 test/FullyConnectedTestHelper.hpp
Kevin Mayb2831c52023-04-26 17:27:24 +0100285 test/GatherTest.cpp
286 test/GatherTestHelper.hpp
287 test/GatherNdTest.cpp
288 test/GatherNdTestHelper.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +0100289 test/LstmTest.cpp
290 test/LstmTestHelper.hpp
Teresa Charlinf69ae562023-04-27 14:42:23 +0100291 test/LogicalTest.cpp
292 test/LogicalTestHelper.hpp
293 test/NormalizationTest.cpp
294 test/NormalizationTestHelper.hpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +0100295 test/PackTest.cpp
296 test/PackTestHelper.hpp
297 test/PadTest.cpp
298 test/PadTestHelper.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +0100299 test/Pooling2dTest.cpp
300 test/Pooling2dTestHelper.hpp
301 test/Pooling3dTest.cpp
302 test/Pooling3dTestHelper.hpp
Matthew Sloyan0bd4c622023-04-27 11:48:26 +0100303 test/PreluTest.cpp
304 test/PreluTestHelper.hpp
Matthew Sloyan48ec8132023-04-27 17:04:47 +0100305 test/RoundTest.cpp
306 test/RoundTestHelper.hpp
John Mcloughlin0422cf22023-04-27 16:55:00 +0100307 test/ShapeTest.cpp
308 test/ShapeTestHelper.hpp
Matthew Sloyan080ffd82023-04-24 12:53:04 +0100309 test/TestUtils.hpp
Francis Murtagh3a9e7ba2023-04-26 15:58:39 +0100310 test/TestUtils.cpp
Teresa Charlinecebb0f2023-04-27 21:37:56 +0100311 test/TransposeConvolution2dTest.cpp
312 test/UnpackTest.cpp
313 test/UnpackTestHelper.hpp)
Matthew Sloyan65c21a12023-04-04 12:06:14 +0100314
315 # Until all operators are supported, we have to add tests one by one above to opaqueDelegate_unittest_sources.
316 # After we add can add commonDelegate_unittest_sources to the add_executable below.
317 add_executable(OpaqueDelegateUnitTests ${opaqueDelegate_unittest_sources})
318
319 target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
320 target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test")
321 target_include_directories(OpaqueDelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR})
322
323 # Add half library from armnn third-party libraries
324 target_link_libraries(OpaqueDelegateUnitTests PRIVATE thirdparty_headers)
325 target_link_libraries(OpaqueDelegateUnitTests PRIVATE armnnOpaqueDelegate)
326 target_link_libraries(OpaqueDelegateUnitTests PRIVATE Armnn::armnnUtils)
327 target_link_libraries(OpaqueDelegateUnitTests PRIVATE profiling_library_headers)
328 endif()
Sadik Armagan4189cc52020-11-11 18:01:48 +0000329endif()
Sadik Armagan3c24f432020-10-19 17:35:30 +0100330
Jan Eilersa96489a2021-12-08 10:05:47 +0000331if(BUILD_DELEGATE_JNI_INTERFACE)
332 add_subdirectory(armnnDelegateJNI)
333endif()
334
Sadik Armagan3c24f432020-10-19 17:35:30 +0100335####################################################
336## Export targets
337set(armnn_delegate_export_targets)
338list(APPEND armnn_delegate_export_targets
Teresa Charlinad1b3d72023-03-14 12:10:28 +0000339 armnnClassicDelegateObject
Finn Williams6f9f9902020-11-13 13:23:15 +0000340 armnnDelegate
341 tflite_headers
Jan Eilersc837f1e2021-11-08 10:19:31 +0000342 flatbuffer_headers
343 profiling_library_headers
344 thirdparty_headers)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100345
346install(
347 TARGETS ${armnn_delegate_export_targets}
348 EXPORT armnn-delegate-targets
349 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
350 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
351 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
352
353## Set export alias
354set_target_properties(armnnDelegate
355 PROPERTIES
356 EXPORT_NAME ArmnnDelegate)
357
358## Export target scrips
359install(
360 EXPORT armnn-delegate-targets
361 FILE ArmnnDelegateTargets.cmake
362 NAMESPACE ArmnnDelegate::
363 DESTINATION ${CMAKE_INSTALL_LIBDIR})
364
365## Create ArmnnDelegateConfig.cmake
366include(CMakePackageConfigHelpers)
367set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR})
368message(STATUS "CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}" )
369message(STATUS "CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}" )
Finn Williamsbbbefec2020-11-25 14:32:42 +0000370SET(Armnn_DIR "${Armnn_DIR}")
371
Sadik Armagan3c24f432020-10-19 17:35:30 +0100372configure_package_config_file(
373 ${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/ArmnnDelegateConfig.cmake.in
374 ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake
Finn Williamsbbbefec2020-11-25 14:32:42 +0000375 INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
376 PATH_VARS Armnn_DIR)
Sadik Armagan3c24f432020-10-19 17:35:30 +0100377
378## Install ArmNN Delegate config file
379install(
380 FILES
381 ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake
382 DESTINATION ${INSTALL_CONFIGDIR})
383
384## Export from build tree
385export(
386 EXPORT armnn-delegate-targets
387 FILE ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateTargets.cmake
388 NAMESPACE ArmnnDelegate::)
Sadik Armagan5d03e312020-11-17 16:43:56 +0000389add_library(ArmnnDelegate::ArmnnDelegate ALIAS armnnDelegate)
390
Sadik Armagan3c24f432020-10-19 17:35:30 +0100391
Narumol Prangnawarat50c87d32020-11-09 18:42:11 +0000392####################################################