Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 1 | # |
Ryan OShea | b554054 | 2022-07-06 09:52:52 +0100 | [diff] [blame] | 2 | # Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
Jan Eilers | b968a4f | 2020-11-15 14:44:43 +0000 | [diff] [blame] | 6 | cmake_minimum_required (VERSION 3.7.0) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 7 | project(armnnDelegate) |
Ryan OShea | 238ecd9 | 2023-03-07 11:44:23 +0000 | [diff] [blame] | 8 | set(CMAKE_CXX_STANDARD 17) |
| 9 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
Ryan OShea | 238ecd9 | 2023-03-07 11:44:23 +0000 | [diff] [blame] | 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -Wno-comment") |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/") |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 12 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 13 | option(BUILD_UNIT_TESTS "Build unit tests" ON) |
| 14 | option(BUILD_CLASSIC_DELEGATE "Build classic delegate" ON) |
| 15 | option(BUILD_OPAQUE_DELEGATE "Build opaque delegate" OFF) |
| 16 | option(BUILD_SHARED_LIBS "Build share libs" ON) |
| 17 | option(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 Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 20 | set(armnnDelegate_sources) |
| 21 | list(APPEND armnnDelegate_sources |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 22 | common/include/DelegateOptions.hpp |
| 23 | common/src/DelegateOptions.cpp |
| 24 | common/src/DelegateUtils.hpp) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 25 | |
| 26 | ## Add Armnn as a Dependency |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 27 | if(NOT ARMNN_SUB_PROJECT) |
| 28 | find_package(Armnn REQUIRED CONFIG HINTS ${Armnn_DIR}) |
| 29 | endif() |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 30 | |
| 31 | if (BUILD_CLASSIC_DELEGATE) |
| 32 | add_subdirectory(classic) |
| 33 | add_library(armnnDelegate ${armnnDelegate_sources}) |
| 34 | |
| 35 | target_include_directories(armnnDelegate |
| 36 | PUBLIC |
| 37 | $<INSTALL_INTERFACE:include> |
| 38 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> |
| 39 | PRIVATE |
| 40 | ${CMAKE_CURRENT_SOURCE_DIR}/common/src) |
| 41 | endif() |
| 42 | if (BUILD_OPAQUE_DELEGATE) |
| 43 | add_subdirectory(opaque) |
| 44 | add_library(armnnOpaqueDelegate ${armnnDelegate_sources}) |
| 45 | |
| 46 | target_include_directories(armnnOpaqueDelegate |
| 47 | PUBLIC |
| 48 | $<INSTALL_INTERFACE:include> |
| 49 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common/include> |
| 50 | PRIVATE |
| 51 | ${CMAKE_CURRENT_SOURCE_DIR}/common/src) |
| 52 | endif() |
| 53 | |
| 54 | include(GNUInstallDirs) |
| 55 | |
| 56 | if (BUILD_CLASSIC_DELEGATE) |
| 57 | target_link_libraries(armnnDelegate PUBLIC Armnn::Armnn) |
| 58 | |
| 59 | ## Add armnnClassicDelegateObject as a Dependency |
| 60 | target_link_libraries(armnnDelegate PUBLIC armnnClassicDelegateObject) |
| 61 | endif() |
| 62 | if (BUILD_OPAQUE_DELEGATE) |
| 63 | target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::Armnn) |
| 64 | |
| 65 | ## Add armnnOpaqueDelegateObject as a Dependency |
| 66 | target_link_libraries(armnnOpaqueDelegate PUBLIC armnnOpaqueDelegateObject) |
| 67 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 68 | |
Keith Davis | 9a701c8 | 2021-09-28 16:43:24 +0100 | [diff] [blame] | 69 | ## Add TfLite dependency |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 70 | find_package(TfLiteSrc REQUIRED MODULE) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 71 | find_package(TfLite REQUIRED MODULE) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 72 | if (BUILD_CLASSIC_DELEGATE) |
| 73 | target_link_libraries(armnnDelegate PUBLIC ${TfLite_LIB}) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 74 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 75 | # lpthread and ldl are not required for Android |
| 76 | if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) |
| 77 | target_link_libraries(armnnDelegate PUBLIC -lpthread) |
| 78 | target_link_libraries(armnnDelegate PUBLIC -ldl) |
| 79 | endif() |
Keith Davis | d62eef9 | 2021-09-20 18:17:33 +0100 | [diff] [blame] | 80 | endif() |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 81 | if (BUILD_OPAQUE_DELEGATE) |
| 82 | target_link_libraries(armnnOpaqueDelegate PUBLIC ${TfLite_LIB}) |
Keith Davis | d62eef9 | 2021-09-20 18:17:33 +0100 | [diff] [blame] | 83 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 84 | # lpthread and ldl are not required for Android |
| 85 | if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Android) |
| 86 | target_link_libraries(armnnOpaqueDelegate PUBLIC -lpthread) |
| 87 | target_link_libraries(armnnOpaqueDelegate PUBLIC -ldl) |
| 88 | endif() |
| 89 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 90 | |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 91 | # Add libraries from armnn third-party libraries |
| 92 | # Third-party header files are not warning clean |
| 93 | # We can't change compilation flags on header files directly, so we need to add them to an interface library first |
| 94 | add_library(thirdparty_headers INTERFACE) |
| 95 | target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/third-party> |
| 96 | $<INSTALL_INTERFACE:include/thirdparty_headers>) |
| 97 | |
| 98 | target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 99 | if (BUILD_CLASSIC_DELEGATE) |
| 100 | target_link_libraries(armnnDelegate PUBLIC thirdparty_headers) |
| 101 | endif() |
| 102 | if (BUILD_OPAQUE_DELEGATE) |
| 103 | target_link_libraries(armnnOpaqueDelegate PUBLIC thirdparty_headers) |
| 104 | endif() |
Narumol Prangnawarat | 4cf0fe3 | 2020-12-18 16:13:06 +0000 | [diff] [blame] | 105 | |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 106 | add_library(profiling_library_headers INTERFACE) |
| 107 | target_include_directories(profiling_library_headers INTERFACE $<BUILD_INTERFACE:${ARMNN_SOURCE_DIR}/profiling> |
| 108 | $<INSTALL_INTERFACE:include/profiling_library_headers>) |
Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 109 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 110 | if (BUILD_CLASSIC_DELEGATE) |
| 111 | target_link_libraries(armnnDelegate PUBLIC profiling_library_headers) |
| 112 | target_link_libraries(armnnDelegate PUBLIC Armnn::armnnUtils) |
Matthew Sloyan | ac001ee | 2021-02-03 10:43:04 +0000 | [diff] [blame] | 113 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 114 | set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION}) |
| 115 | endif() |
| 116 | if (BUILD_OPAQUE_DELEGATE) |
| 117 | target_link_libraries(armnnOpaqueDelegate PUBLIC profiling_library_headers) |
| 118 | target_link_libraries(armnnOpaqueDelegate PUBLIC Armnn::armnnUtils) |
| 119 | |
| 120 | set_target_properties(armnnOpaqueDelegate PROPERTIES VERSION ${OPAQUE_DELEGATE_LIB_VERSION} SOVERSION ${OPAQUE_DELEGATE_LIB_SOVERSION}) |
| 121 | endif() |
| 122 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 123 | if(BUILD_UNIT_TESTS) |
| 124 | set(commonDelegate_unittest_sources) |
| 125 | list(APPEND commonDelegate_unittest_sources |
| 126 | common/src/test/DelegateTestInterpreter.hpp |
| 127 | common/src/test/DelegateTestInterpreterUtils.hpp |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 128 | test/ActivationTest.cpp |
| 129 | test/ActivationTestHelper.hpp |
| 130 | test/ArgMinMaxTest.cpp |
| 131 | test/ArgMinMaxTestHelper.hpp |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 132 | test/BatchMatMulTest.cpp |
| 133 | test/BatchMatMulTestHelper.hpp |
| 134 | test/BatchSpaceTest.cpp |
| 135 | test/BatchSpaceTestHelper.hpp |
| 136 | test/CastTest.cpp |
| 137 | test/CastTestHelper.hpp |
| 138 | test/ComparisonTest.cpp |
| 139 | test/ComparisonTestHelper.hpp |
| 140 | test/ControlTest.cpp |
| 141 | test/ControlTestHelper.hpp |
| 142 | test/Convolution2dTest.cpp |
| 143 | test/Convolution3dTest.cpp |
| 144 | test/ConvolutionTestHelper.hpp |
| 145 | test/DelegateOptionsTest.cpp |
| 146 | test/DelegateOptionsTestHelper.hpp |
| 147 | test/DepthwiseConvolution2dTest.cpp |
| 148 | test/ElementwiseBinaryTest.cpp |
| 149 | test/ElementwiseBinaryTestHelper.hpp |
| 150 | test/ElementwiseUnaryTest.cpp |
| 151 | test/ElementwiseUnaryTestHelper.hpp |
| 152 | test/FillTest.cpp |
| 153 | test/FillTestHelper.hpp |
| 154 | test/FullyConnectedTest.cpp |
| 155 | test/FullyConnectedTestHelper.hpp |
| 156 | test/GatherTest.cpp |
| 157 | test/GatherTestHelper.hpp |
| 158 | test/GatherNdTest.cpp |
| 159 | test/GatherNdTestHelper.hpp |
| 160 | test/LogicalTest.cpp |
| 161 | test/LogicalTestHelper.hpp |
| 162 | test/LstmTest.cpp |
| 163 | test/LstmTestHelper.hpp |
| 164 | test/MirrorPadTest.cpp |
| 165 | test/NormalizationTest.cpp |
| 166 | test/NormalizationTestHelper.hpp |
| 167 | test/PackTest.cpp |
| 168 | test/PackTestHelper.hpp |
| 169 | test/PadTest.cpp |
| 170 | test/PadTestHelper.hpp |
| 171 | test/Pooling2dTest.cpp |
| 172 | test/Pooling2dTestHelper.hpp |
| 173 | test/Pooling3dTest.cpp |
| 174 | test/Pooling3dTestHelper.hpp |
| 175 | test/PreluTest.cpp |
| 176 | test/PreluTestHelper.hpp |
| 177 | test/QuantizationTest.cpp |
| 178 | test/QuantizationTestHelper.hpp |
| 179 | test/RedefineTestHelper.hpp |
| 180 | test/ReduceTest.cpp |
| 181 | test/ReduceTestHelper.hpp |
| 182 | test/ReshapeTest.cpp |
| 183 | test/ResizeTest.cpp |
| 184 | test/ResizeTestHelper.hpp |
| 185 | test/RoundTest.cpp |
| 186 | test/RoundTestHelper.hpp |
| 187 | test/SoftmaxTest.cpp |
| 188 | test/SoftmaxTestHelper.hpp |
| 189 | test/SpaceDepthTest.cpp |
| 190 | test/SpaceDepthTestHelper.hpp |
| 191 | test/ShapeTest.cpp |
| 192 | test/ShapeTestHelper.hpp |
| 193 | test/SliceTest.cpp |
| 194 | test/SliceTestHelper.hpp |
| 195 | test/StridedSliceTest.cpp |
| 196 | test/StridedSliceTestHelper.hpp |
| 197 | test/SplitTest.cpp |
| 198 | test/SplitTestHelper.hpp |
| 199 | test/TestUtils.hpp |
| 200 | test/TestUtils.cpp |
| 201 | test/TransposeTest.cpp |
| 202 | test/TransposeTestHelper.hpp |
| 203 | test/UnidirectionalSequenceLstmTest.cpp |
| 204 | test/UnidirectionalSequenceLstmTestHelper.hpp |
| 205 | test/UnpackTest.cpp |
| 206 | test/UnpackTestHelper.hpp) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 207 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 208 | # There's a known Android NDK bug which causes a subset of NeonLayerTests to |
| 209 | # fail. We'll exclude these tests in NeonLayerTests_NDK_Bug.cpp if we're doing |
| 210 | # a debug build and NDK is less than r21. |
| 211 | # https://github.com/android/ndk/issues/1135 |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 212 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 213 | # Default to always including these tests. |
| 214 | set(INCLUDE_NDK_BUG_TESTS "ON") |
| 215 | # Reconsider if we in a debug build. |
| 216 | string( TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE_LOWERCASE ) |
| 217 | if ( NOT BUILD_TYPE_LOWERCASE STREQUAL "release" ) |
| 218 | message("CMAKE:: BUILD TYPE IS ${CMAKE_BUILD_TYPE}") |
| 219 | # And NDK_VERSION has been set. |
| 220 | if ( DEFINED NDK_VERSION ) |
| 221 | message("CMAKE:: NDK DEFINED") |
| 222 | # And the version is less than r21. |
| 223 | if ( ${NDK_VERSION} STRLESS "r21" ) |
| 224 | message("CMAKE:: BUG TESTS OFF") |
| 225 | set(INCLUDE_NDK_BUG_TESTS "OFF") |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 226 | endif() |
| 227 | endif() |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 228 | endif() |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 229 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 230 | if ( INCLUDE_NDK_BUG_TESTS STREQUAL "ON" ) |
| 231 | list(APPEND commonDelegate_unittest_sources |
| 232 | test/NeonDelegateTests_NDK_Issue.cpp) |
| 233 | endif() |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 234 | |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 235 | if (BUILD_CLASSIC_DELEGATE) |
| 236 | set(classicDelegate_unittest_sources) |
| 237 | list(APPEND classicDelegate_unittest_sources |
| 238 | classic/src/test/ArmnnClassicDelegateTest.cpp |
| 239 | classic/src/test/DelegateTestInterpreter.cpp) |
| 240 | |
| 241 | add_executable(DelegateUnitTests ${commonDelegate_unittest_sources} ${classicDelegate_unittest_sources}) |
Keith Davis | 7c67fab | 2021-04-08 11:47:23 +0100 | [diff] [blame] | 242 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 243 | target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") |
Matthew Sloyan | ebe392d | 2023-03-30 10:12:08 +0100 | [diff] [blame] | 244 | target_include_directories(DelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test") |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 245 | target_include_directories(DelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR}) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 246 | |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 247 | # Add half library from armnn third-party libraries |
| 248 | target_link_libraries(DelegateUnitTests PRIVATE thirdparty_headers) |
Ryan OShea | ac9607f | 2023-04-03 11:33:33 +0100 | [diff] [blame] | 249 | target_link_libraries(DelegateUnitTests PRIVATE armnnDelegate) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 250 | target_link_libraries(DelegateUnitTests PRIVATE Armnn::armnnUtils) |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 251 | target_link_libraries(DelegateUnitTests PRIVATE profiling_library_headers) |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 252 | endif() |
| 253 | |
| 254 | if (BUILD_OPAQUE_DELEGATE) |
| 255 | set(opaqueDelegate_unittest_sources) |
| 256 | list(APPEND opaqueDelegate_unittest_sources |
| 257 | common/src/test/DelegateTestInterpreter.hpp |
| 258 | common/src/test/DelegateTestInterpreterUtils.hpp |
| 259 | opaque/src/test/ArmnnOpaqueDelegateTest.cpp |
| 260 | opaque/src/test/DelegateTestInterpreter.cpp |
| 261 | test/TestUtils.hpp |
Ryan OShea | a37ccb0 | 2023-04-11 10:54:07 +0100 | [diff] [blame] | 262 | test/TestUtils.cpp |
| 263 | test/CastTest.cpp |
| 264 | test/CastTestHelper.hpp) |
Matthew Sloyan | 65c21a1 | 2023-04-04 12:06:14 +0100 | [diff] [blame] | 265 | |
| 266 | # Until all operators are supported, we have to add tests one by one above to opaqueDelegate_unittest_sources. |
| 267 | # After we add can add commonDelegate_unittest_sources to the add_executable below. |
| 268 | add_executable(OpaqueDelegateUnitTests ${opaqueDelegate_unittest_sources}) |
| 269 | |
| 270 | target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}") |
| 271 | target_include_directories(OpaqueDelegateUnitTests SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common/src/test") |
| 272 | target_include_directories(OpaqueDelegateUnitTests PUBLIC ${PROJECT_SOURCE_DIR}) |
| 273 | |
| 274 | # Add half library from armnn third-party libraries |
| 275 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE thirdparty_headers) |
| 276 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE armnnOpaqueDelegate) |
| 277 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE Armnn::armnnUtils) |
| 278 | target_link_libraries(OpaqueDelegateUnitTests PRIVATE profiling_library_headers) |
| 279 | endif() |
Sadik Armagan | 4189cc5 | 2020-11-11 18:01:48 +0000 | [diff] [blame] | 280 | endif() |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 281 | |
Jan Eilers | a96489a | 2021-12-08 10:05:47 +0000 | [diff] [blame] | 282 | if(BUILD_DELEGATE_JNI_INTERFACE) |
| 283 | add_subdirectory(armnnDelegateJNI) |
| 284 | endif() |
| 285 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 286 | #################################################### |
| 287 | ## Export targets |
| 288 | set(armnn_delegate_export_targets) |
| 289 | list(APPEND armnn_delegate_export_targets |
Teresa Charlin | ad1b3d7 | 2023-03-14 12:10:28 +0000 | [diff] [blame] | 290 | armnnClassicDelegateObject |
Finn Williams | 6f9f990 | 2020-11-13 13:23:15 +0000 | [diff] [blame] | 291 | armnnDelegate |
| 292 | tflite_headers |
Jan Eilers | c837f1e | 2021-11-08 10:19:31 +0000 | [diff] [blame] | 293 | flatbuffer_headers |
| 294 | profiling_library_headers |
| 295 | thirdparty_headers) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 296 | |
| 297 | install( |
| 298 | TARGETS ${armnn_delegate_export_targets} |
| 299 | EXPORT armnn-delegate-targets |
| 300 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 301 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 302 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 303 | |
| 304 | ## Set export alias |
| 305 | set_target_properties(armnnDelegate |
| 306 | PROPERTIES |
| 307 | EXPORT_NAME ArmnnDelegate) |
| 308 | |
| 309 | ## Export target scrips |
| 310 | install( |
| 311 | EXPORT armnn-delegate-targets |
| 312 | FILE ArmnnDelegateTargets.cmake |
| 313 | NAMESPACE ArmnnDelegate:: |
| 314 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 315 | |
| 316 | ## Create ArmnnDelegateConfig.cmake |
| 317 | include(CMakePackageConfigHelpers) |
| 318 | set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}) |
| 319 | message(STATUS "CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}" ) |
| 320 | message(STATUS "CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}" ) |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 321 | SET(Armnn_DIR "${Armnn_DIR}") |
| 322 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 323 | configure_package_config_file( |
| 324 | ${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/ArmnnDelegateConfig.cmake.in |
| 325 | ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake |
Finn Williams | bbbefec | 2020-11-25 14:32:42 +0000 | [diff] [blame] | 326 | INSTALL_DESTINATION ${INSTALL_CONFIGDIR} |
| 327 | PATH_VARS Armnn_DIR) |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 328 | |
| 329 | ## Install ArmNN Delegate config file |
| 330 | install( |
| 331 | FILES |
| 332 | ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateConfig.cmake |
| 333 | DESTINATION ${INSTALL_CONFIGDIR}) |
| 334 | |
| 335 | ## Export from build tree |
| 336 | export( |
| 337 | EXPORT armnn-delegate-targets |
| 338 | FILE ${CMAKE_CURRENT_BINARY_DIR}/ArmnnDelegateTargets.cmake |
| 339 | NAMESPACE ArmnnDelegate::) |
Sadik Armagan | 5d03e31 | 2020-11-17 16:43:56 +0000 | [diff] [blame] | 340 | add_library(ArmnnDelegate::ArmnnDelegate ALIAS armnnDelegate) |
| 341 | |
Sadik Armagan | 3c24f43 | 2020-10-19 17:35:30 +0100 | [diff] [blame] | 342 | |
Narumol Prangnawarat | 50c87d3 | 2020-11-09 18:42:11 +0000 | [diff] [blame] | 343 | #################################################### |