File: CMakeLists.txt

package info (click to toggle)
armnn 19.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,388 kB
  • sloc: cpp: 159,089; ansic: 8,175; sh: 113; makefile: 13; asm: 12
file content (976 lines) | stat: -rw-r--r-- 40,225 bytes parent folder | download
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
#
# Copyright © 2017 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
#
cmake_minimum_required (VERSION 3.0.2) # 3.0.2 required for return() statement used in AddDllCopyCommands.cmake
project(armnn)

include(FindPkgConfig)

set(additional_cmake_files)
list(APPEND additional_cmake_files
    cmake/ArmnnVersion.cmake
    cmake/Utils.cmake
    cmake/GlobalConfig.cmake
    cmake/AddDllCopyCommands.cmake)

foreach(cmake_file ${additional_cmake_files})
    include(${cmake_file})
endforeach()

if (DYNAMIC_BACKEND_PATHS)
    # It's expected to have the format: DYNAMIC_BACKEND_PATHS="PATH_1:PATH_2...:PATH_N"
    add_definitions('-DDYNAMIC_BACKEND_PATHS="${DYNAMIC_BACKEND_PATHS}"')
endif()

include(GNUInstallDirs)

add_subdirectory(samples)
add_subdirectory(src/armnnTfLiteParser)
add_subdirectory(src/armnnSerializer)

if (BUILD_TESTS)
    add_subdirectory(tests)
endif()

# Include the additional cmake files in their own target so that they will appear nicely in IDEs
add_custom_target(AdditionalCMakeFiles SOURCES ${additional_cmake_files})

set(armnnUtils_sources)
list(APPEND armnnUtils_sources
    src/armnnUtils/GraphTopologicalSort.hpp
    src/armnnUtils/Half.hpp
    src/armnnUtils/Logging.hpp
    src/armnnUtils/Logging.cpp
    src/armnnUtils/Permute.hpp
    src/armnnUtils/Permute.cpp
    src/armnnUtils/DataLayoutIndexed.cpp
    src/armnnUtils/DataLayoutIndexed.hpp
    src/armnnUtils/DotSerializer.cpp
    src/armnnUtils/DotSerializer.hpp
    src/armnnUtils/HeapProfiling.cpp
    src/armnnUtils/HeapProfiling.hpp
    src/armnnUtils/LeakChecking.cpp
    src/armnnUtils/LeakChecking.hpp
    src/armnnUtils/ModelAccuracyChecker.cpp
    src/armnnUtils/ModelAccuracyChecker.hpp
    src/armnnUtils/CsvReader.cpp
    src/armnnUtils/CsvReader.hpp
    src/armnnUtils/FloatingPointConverter.cpp
    src/armnnUtils/FloatingPointConverter.hpp
    src/armnnUtils/VerificationHelpers.hpp
    src/armnnUtils/VerificationHelpers.cpp
    src/armnnUtils/ParserHelper.hpp
    src/armnnUtils/ParserHelper.cpp
    src/armnnUtils/ParserPrototxtFixture.hpp
    src/armnnUtils/PrototxtConversions.hpp
    src/armnnUtils/PrototxtConversions.cpp
    src/armnnUtils/QuantizeHelper.hpp
    src/armnnUtils/TensorIOUtils.hpp
    src/armnnUtils/TensorUtils.hpp
    src/armnnUtils/TensorUtils.cpp
    )

add_library_ex(armnnUtils STATIC ${armnnUtils_sources})
target_include_directories(armnnUtils PRIVATE src/backends)

if(BUILD_CAFFE_PARSER)
    # ArmNN Parser source files required for all build options
    set(armnn_caffe_parser_sources)
    list(APPEND armnn_caffe_parser_sources
        include/armnnCaffeParser/ICaffeParser.hpp
        src/armnnCaffeParser/RecordByRecordCaffeParser.hpp
        src/armnnCaffeParser/RecordByRecordCaffeParser.cpp
        src/armnnCaffeParser/CaffeParser.hpp
        src/armnnCaffeParser/CaffeParser.cpp
        ${CAFFE_GENERATED_SOURCES}/caffe/proto/caffe.pb.cc
        )
    # The generated Caffe protobuf .cc file is not warning clean and we can't fix them.
    if(COMPILER_IS_GNU_LIKE)
        set_source_files_properties(${CAFFE_GENERATED_SOURCES}/caffe/proto/caffe.pb.cc PROPERTIES COMPILE_FLAGS "-Wno-conversion -Wno-sign-conversion")
    endif()

    add_library_ex(armnnCaffeParser SHARED ${armnn_caffe_parser_sources})
    set_target_properties(armnnCaffeParser PROPERTIES COMPILE_FLAGS "${CAFFE_PARSER_ADDITIONAL_COMPILE_FLAGS}")

    target_include_directories(armnnCaffeParser PRIVATE src/armnnUtils)

    target_link_libraries(armnnCaffeParser ${Boost_LOG_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY})

    target_link_libraries(armnnCaffeParser armnn)
    target_link_libraries(armnnCaffeParser ${PROTOBUF_LIBRARIES})
    set_target_properties(armnnCaffeParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})

endif()

if(BUILD_ONNX_PARSER)
    set(armnn_onnx_parser_sources)
    list(APPEND armnn_onnx_parser_sources
        include/armnnOnnxParser/IOnnxParser.hpp
        src/armnnOnnxParser/OnnxParser.hpp
        src/armnnOnnxParser/OnnxParser.cpp
        ${ONNX_GENERATED_SOURCES}/onnx/onnx.pb.cc
        )
    # The generated onnx protobuf .cc files are not warning clean and we can't fix them.
    if(COMPILER_IS_GNU_LIKE)
        set_source_files_properties(${ONNX_GENERATED_SOURCES}/onnx/onnx.pb.cc PROPERTIES COMPILE_FLAGS "-Wno-conversion -Wno-sign-conversion")
    endif()

    add_library_ex(armnnOnnxParser SHARED ${armnn_onnx_parser_sources})

    target_include_directories(armnnOnnxParser PRIVATE src/armnnUtils)

    target_link_libraries(armnnOnnxParser armnn)

    # Protobuf
    target_link_libraries(armnnOnnxParser ${PROTOBUF_LIBRARIES})
    set_target_properties(armnnOnnxParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
endif()

if(BUILD_TF_PARSER)
    set(armnn_tf_parser_sources)
    list(APPEND armnn_tf_parser_sources
        include/armnnTfParser/ITfParser.hpp
        src/armnnTfParser/TfParser.hpp
        src/armnnTfParser/TfParser.cpp
        ${TF_PROTOBUFS}
        )
    # The generated tensorflow protobuf .cc files are not warning clean and we can't fix them.
    if(COMPILER_IS_GNU_LIKE)
        set_source_files_properties(${TF_PROTOBUFS} PROPERTIES COMPILE_FLAGS "-Wno-conversion -Wno-sign-conversion")
    endif()

    add_library_ex(armnnTfParser SHARED ${armnn_tf_parser_sources})

    target_include_directories(armnnTfParser PRIVATE src/armnnUtils)

    target_link_libraries(armnnTfParser armnn)

    # Protobuf (use the specific version tensorflow wants)
    target_link_libraries(armnnTfParser ${PROTOBUF_LIBRARIES})
    set_target_properties(armnnTfParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
endif()

if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
    if(NOT BUILD_ARMNN_SERIALIZER)
        message(ERROR, "In order to build the ArmNN Quantization Tool you must set BUILD_ARMNN_SERIALIZER = YES")
    endif()

    set(armnn_quantizer_sources)
    list(APPEND armnn_quantizer_sources
        src/armnnQuantizer/QuantizationDataSet.hpp
        src/armnnQuantizer/QuantizationDataSet.cpp
        src/armnnQuantizer/QuantizationInput.hpp
        src/armnnQuantizer/QuantizationInput.cpp
        src/armnnQuantizer/CommandLineProcessor.hpp
        src/armnnQuantizer/CommandLineProcessor.cpp
        )

    add_library_ex(armnnQuantizer SHARED ${armnn_quantizer_sources})

    target_include_directories(armnnQuantizer PRIVATE include/armnnDeserializer)
    target_include_directories(armnnQuantizer PRIVATE src/armnnUtils)
    target_include_directories(armnnQuantizer PRIVATE src/armnn)

    include_directories(SYSTEM "${FLATBUFFERS_INCLUDE_PATH}")
    set_target_properties(armnnQuantizer PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

    target_link_libraries(armnnQuantizer
            armnn
            ${Boost_SYSTEM_LIBRARY}
            ${Boost_PROGRAM_OPTIONS_LIBRARY}
            ${Boost_FILESYSTEM_LIBRARY}
            ${Boost_LOG_LIBRARY}
            ${Boost_THREAD_LIBRARY} )

    add_executable_ex(ArmnnQuantizer
        src/armnnQuantizer/ArmNNQuantizerMain.cpp)

    target_include_directories(ArmnnQuantizer PRIVATE include/armnnDeserializer)
    target_include_directories(ArmnnQuantizer PRIVATE src/armnn)

    target_link_libraries(ArmnnQuantizer
            ${Boost_SYSTEM_LIBRARY}
            ${Boost_PROGRAM_OPTIONS_LIBRARY}
            ${Boost_FILESYSTEM_LIBRARY}
            ${Boost_LOG_LIBRARY}
            ${Boost_THREAD_LIBRARY} )

    target_link_libraries(ArmnnQuantizer
            armnnQuantizer
            armnnSerializer
            armnn
            armnnUtils
            ${FLATBUFFERS_LIBRARY})

    if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
        target_link_libraries(ArmnnQuantizer ${CMAKE_THREAD_LIBS_INIT})
    endif()

    set_target_properties(armnnQuantizer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})

endif()


list(APPEND armnn_sources
    include/armnn/ArmNN.hpp
    include/armnn/BackendHelper.hpp
    include/armnn/BackendId.hpp
    include/armnn/BackendRegistry.hpp
    include/armnn/Conversion.hpp
    include/armnn/Deprecated.hpp
    include/armnn/Descriptors.hpp
    include/armnn/DescriptorsFwd.hpp
    include/armnn/Exceptions.hpp
    include/armnn/ILayerSupport.hpp
    include/armnn/ILayerVisitor.hpp
    include/armnn/INetwork.hpp
    include/armnn/IProfiler.hpp
    include/armnn/IProfilingGuidGenerator.hpp
    include/armnn/IRuntime.hpp
    include/armnn/LayerSupport.hpp
    include/armnn/LayerVisitorBase.hpp
    include/armnn/LstmParams.hpp
    include/armnn/MemorySources.hpp
    include/armnn/NetworkFwd.hpp
    include/armnn/Optional.hpp
    include/armnn/QuantizedLstmParams.hpp
    include/armnn/Tensor.hpp
    include/armnn/TensorFwd.hpp
    include/armnn/Types.hpp
    include/armnn/TypesUtils.hpp
    include/armnn/Utils.hpp
    include/armnn/Version.hpp
    src/armnn/layers/LayerCloneBase.hpp
    src/armnn/layers/LayerWithParameters.hpp
    src/armnn/layers/AbsLayer.hpp
    src/armnn/layers/AbsLayer.cpp
    src/armnn/layers/ActivationLayer.hpp
    src/armnn/layers/ActivationLayer.cpp
    src/armnn/layers/AdditionLayer.hpp
    src/armnn/layers/AdditionLayer.cpp
    src/armnn/layers/ArgMinMaxLayer.hpp
    src/armnn/layers/ArgMinMaxLayer.cpp
    src/armnn/layers/BatchNormalizationLayer.hpp
    src/armnn/layers/BatchNormalizationLayer.cpp
    src/armnn/layers/BatchToSpaceNdLayer.hpp
    src/armnn/layers/BatchToSpaceNdLayer.cpp
    src/armnn/layers/ComparisonLayer.hpp
    src/armnn/layers/ComparisonLayer.cpp
    src/armnn/layers/ConcatLayer.hpp
    src/armnn/layers/ConcatLayer.cpp
    src/armnn/layers/ConstantLayer.hpp
    src/armnn/layers/ConstantLayer.cpp
    src/armnn/layers/Convolution2dLayer.hpp
    src/armnn/layers/Convolution2dLayer.cpp
    src/armnn/layers/ConvertFp16ToFp32Layer.hpp
    src/armnn/layers/ConvertFp16ToFp32Layer.cpp
    src/armnn/layers/ConvertFp32ToFp16Layer.hpp
    src/armnn/layers/ConvertFp32ToFp16Layer.cpp
    src/armnn/layers/DebugLayer.hpp
    src/armnn/layers/DebugLayer.cpp
    src/armnn/layers/DepthToSpaceLayer.hpp
    src/armnn/layers/DepthToSpaceLayer.cpp
    src/armnn/layers/DepthwiseConvolution2dLayer.hpp
    src/armnn/layers/DepthwiseConvolution2dLayer.cpp
    src/armnn/layers/DequantizeLayer.hpp
    src/armnn/layers/DequantizeLayer.cpp
    src/armnn/layers/DetectionPostProcessLayer.hpp
    src/armnn/layers/DetectionPostProcessLayer.cpp
    src/armnn/layers/ElementwiseBaseLayer.hpp
    src/armnn/layers/ElementwiseBaseLayer.cpp
    src/armnn/layers/FakeQuantizationLayer.hpp
    src/armnn/layers/FakeQuantizationLayer.cpp
    src/armnn/layers/FloorLayer.hpp
    src/armnn/layers/FloorLayer.cpp
    src/armnn/layers/FullyConnectedLayer.hpp
    src/armnn/layers/FullyConnectedLayer.cpp
    src/armnn/layers/GatherLayer.cpp
    src/armnn/layers/GatherLayer.hpp
    src/armnn/layers/InputLayer.hpp
    src/armnn/layers/InputLayer.cpp
    src/armnn/layers/InstanceNormalizationLayer.hpp
    src/armnn/layers/InstanceNormalizationLayer.cpp
    src/armnn/layers/L2NormalizationLayer.hpp
    src/armnn/layers/L2NormalizationLayer.cpp
    src/armnn/layers/LogSoftmaxLayer.hpp
    src/armnn/layers/LogSoftmaxLayer.cpp
    src/armnn/layers/LstmLayer.cpp
    src/armnn/layers/LstmLayer.hpp
    src/armnn/layers/MaximumLayer.cpp
    src/armnn/layers/MaximumLayer.hpp
    src/armnn/layers/MeanLayer.hpp
    src/armnn/layers/MeanLayer.cpp
    src/armnn/layers/MemCopyLayer.hpp
    src/armnn/layers/MemCopyLayer.cpp
    src/armnn/layers/MemImportLayer.hpp
    src/armnn/layers/MemImportLayer.cpp
    src/armnn/layers/MergeLayer.hpp
    src/armnn/layers/MergeLayer.cpp
    src/armnn/layers/MinimumLayer.cpp
    src/armnn/layers/MinimumLayer.hpp
    src/armnn/layers/MultiplicationLayer.hpp
    src/armnn/layers/MultiplicationLayer.cpp
    src/armnn/layers/NormalizationLayer.hpp
    src/armnn/layers/NormalizationLayer.cpp
    src/armnn/layers/OutputLayer.hpp
    src/armnn/layers/OutputLayer.cpp
    src/armnn/layers/PadLayer.hpp
    src/armnn/layers/PadLayer.cpp
    src/armnn/layers/PermuteLayer.hpp
    src/armnn/layers/PermuteLayer.cpp
    src/armnn/layers/Pooling2dLayer.hpp
    src/armnn/layers/Pooling2dLayer.cpp
    src/armnn/layers/QuantizeLayer.cpp
    src/armnn/layers/QuantizeLayer.hpp
    src/armnn/layers/QuantizedLstmLayer.hpp
    src/armnn/layers/QuantizedLstmLayer.cpp
    src/armnn/layers/DivisionLayer.cpp
    src/armnn/layers/DivisionLayer.hpp
    src/armnn/layers/PreCompiledLayer.hpp
    src/armnn/layers/PreCompiledLayer.cpp
    src/armnn/layers/PreluLayer.hpp
    src/armnn/layers/PreluLayer.cpp
    src/armnn/layers/ReshapeLayer.hpp
    src/armnn/layers/ReshapeLayer.cpp
    src/armnn/layers/ResizeLayer.hpp
    src/armnn/layers/ResizeLayer.cpp
    src/armnn/layers/RsqrtLayer.cpp
    src/armnn/layers/RsqrtLayer.hpp
    src/armnn/layers/SliceLayer.cpp
    src/armnn/layers/SliceLayer.hpp
    src/armnn/layers/SoftmaxLayer.hpp
    src/armnn/layers/SoftmaxLayer.cpp
    src/armnn/layers/SpaceToBatchNdLayer.hpp
    src/armnn/layers/SpaceToBatchNdLayer.cpp
    src/armnn/layers/SpaceToDepthLayer.hpp
    src/armnn/layers/SpaceToDepthLayer.cpp
    src/armnn/layers/SplitterLayer.hpp
    src/armnn/layers/SplitterLayer.cpp
    src/armnn/layers/StackLayer.hpp
    src/armnn/layers/StackLayer.cpp
    src/armnn/layers/StandInLayer.cpp
    src/armnn/layers/StandInLayer.hpp
    src/armnn/layers/StridedSliceLayer.cpp
    src/armnn/layers/StridedSliceLayer.hpp
    src/armnn/layers/SubtractionLayer.cpp
    src/armnn/layers/SubtractionLayer.hpp
    src/armnn/layers/SwitchLayer.cpp
    src/armnn/layers/SwitchLayer.hpp
    src/armnn/layers/TransposeConvolution2dLayer.cpp
    src/armnn/layers/TransposeConvolution2dLayer.hpp
    src/armnn/BackendRegistry.cpp
    src/armnn/BackendSettings.hpp
    src/armnn/BackendHelper.cpp
    src/armnn/CompatibleTypes.hpp
    src/armnn/Descriptors.cpp
    src/armnn/DeviceSpec.hpp
    src/armnn/DynamicQuantizationVisitor.cpp
    src/armnn/DynamicQuantizationVisitor.hpp
    src/armnn/Exceptions.cpp
    src/armnn/ExecutionFrame.cpp
    src/armnn/ExecutionFrame.hpp
    src/armnn/Graph.cpp
    src/armnn/Graph.hpp
    src/armnn/IGraphObservable.hpp
    src/armnn/Instrument.hpp
    src/armnn/InternalTypes.cpp
    src/armnn/InternalTypes.hpp
    src/armnn/ISubgraphViewConverter.hpp
    src/armnn/JsonPrinter.cpp
    src/armnn/JsonPrinter.hpp
    src/armnn/Layer.cpp
    src/armnn/LayerFwd.hpp
    src/armnn/Layer.hpp
    src/armnn/LayersFwd.hpp
    src/armnn/LayerSupportCommon.hpp
    src/armnn/LayerSupport.cpp
    src/armnn/LoadedNetwork.cpp
    src/armnn/LoadedNetwork.hpp
    src/armnn/Network.cpp
    src/armnn/Network.hpp
    src/armnn/NetworkQuantizationScheme.hpp
    src/armnn/NetworkQuantizer.cpp
    src/armnn/NetworkQuantizer.hpp
    src/armnn/NetworkQuantizerUtils.cpp
    src/armnn/NetworkQuantizerUtils.hpp
    src/armnn/NetworkUtils.cpp
    src/armnn/NetworkUtils.hpp
    src/armnn/Observable.cpp
    src/armnn/Observable.hpp
    src/armnn/Optimizer.cpp
    src/armnn/Optimizer.hpp
    src/armnn/OverrideInputRangeVisitor.cpp
    src/armnn/OverrideInputRangeVisitor.hpp
    src/armnn/Profiling.cpp
    src/armnn/ProfilingEvent.cpp
    src/armnn/ProfilingEvent.hpp
    src/armnn/Profiling.hpp
    src/armnn/QuantizerVisitor.cpp
    src/armnn/QuantizerVisitor.hpp
    src/armnn/Runtime.cpp
    src/armnn/Runtime.hpp
    src/armnn/RangeTracker.cpp
    src/armnn/RangeTracker.hpp
    src/armnn/ResolveType.hpp
    src/armnn/SerializeLayerParameters.cpp
    src/armnn/SerializeLayerParameters.hpp
    src/armnn/StaticRangeVisitor.cpp
    src/armnn/StaticRangeVisitor.hpp
    src/armnn/SubgraphView.cpp
    src/armnn/SubgraphView.hpp
    src/armnn/SubgraphViewSelector.cpp
    src/armnn/SubgraphViewSelector.hpp
    src/armnn/Tensor.cpp
    src/armnn/TypesUtils.cpp
    src/armnn/Utils.cpp
    src/armnn/WallClockTimer.cpp
    src/armnn/WallClockTimer.hpp
    src/armnn/optimizations/AddDebug.hpp
    src/armnn/optimizations/All.hpp
    src/armnn/optimizations/ConvertConstants.hpp
    src/armnn/optimizations/ConvertFp32NetworkToFp16.hpp
    src/armnn/optimizations/FoldPadIntoConvolution2d.hpp
    src/armnn/optimizations/MovePermuteUp.hpp
    src/armnn/optimizations/Optimization.hpp
    src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp
    src/armnn/optimizations/OptimizeInverseConversions.hpp
    src/armnn/optimizations/OptimizeInversePermutes.hpp
    src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp
    src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.cpp
    src/armnn/optimizations/PermuteAsReshape.hpp
    src/armnn/optimizations/SquashEqualSiblings.hpp
    src/profiling/BufferManager.cpp
    src/profiling/BufferManager.hpp
    src/profiling/CommandHandler.cpp
    src/profiling/CommandHandler.hpp
    src/profiling/CommandHandlerFunctor.cpp
    src/profiling/CommandHandlerFunctor.hpp
    src/profiling/CommandHandlerKey.cpp
    src/profiling/CommandHandlerKey.hpp
    src/profiling/CommandHandlerRegistry.cpp
    src/profiling/CommandHandlerRegistry.hpp
    src/profiling/ConnectionAcknowledgedCommandHandler.cpp
    src/profiling/ConnectionAcknowledgedCommandHandler.hpp
    src/profiling/CounterDirectory.cpp
    src/profiling/CounterDirectory.hpp
    src/profiling/DirectoryCaptureCommandHandler.cpp
    src/profiling/DirectoryCaptureCommandHandler.hpp
    src/profiling/EncodeVersion.hpp
    src/profiling/FileOnlyProfilingConnection.cpp
    src/profiling/FileOnlyProfilingConnection.hpp
    src/profiling/Holder.cpp
    src/profiling/Holder.hpp
    src/profiling/IBufferManager.hpp
    src/profiling/ICounterDirectory.hpp
    src/profiling/ICounterValues.hpp
    src/profiling/ISendCounterPacket.hpp
    src/profiling/ISendTimelinePacket.hpp
    src/profiling/IPacketBuffer.hpp
    src/profiling/IPeriodicCounterCapture.hpp
    src/profiling/IProfilingConnection.hpp
    src/profiling/IProfilingConnectionFactory.hpp
    src/profiling/LabelsAndEventClasses.cpp
    src/profiling/LabelsAndEventClasses.hpp
    src/profiling/Packet.hpp
    src/profiling/PacketBuffer.cpp
    src/profiling/PacketBuffer.hpp
    src/profiling/PacketVersionResolver.cpp
    src/profiling/PacketVersionResolver.hpp
    src/profiling/PeriodicCounterCapture.hpp
    src/profiling/PeriodicCounterCapture.cpp
    src/profiling/PeriodicCounterSelectionCommandHandler.cpp
    src/profiling/PeriodicCounterSelectionCommandHandler.hpp
    src/profiling/PerJobCounterSelectionCommandHandler.cpp
    src/profiling/PerJobCounterSelectionCommandHandler.hpp
    src/profiling/ProfilingConnectionDumpToFileDecorator.cpp
    src/profiling/ProfilingConnectionDumpToFileDecorator.hpp
    src/profiling/ProfilingConnectionFactory.cpp
    src/profiling/ProfilingConnectionFactory.hpp
    src/profiling/ProfilingGuidGenerator.hpp
    src/profiling/ProfilingService.cpp
    src/profiling/ProfilingService.hpp
    src/profiling/ProfilingStateMachine.cpp
    src/profiling/ProfilingStateMachine.hpp
    src/profiling/ProfilingUtils.cpp
    src/profiling/ProfilingUtils.hpp
    src/profiling/RequestCounterDirectoryCommandHandler.cpp
    src/profiling/RequestCounterDirectoryCommandHandler.hpp
    src/profiling/SendCounterPacket.cpp
    src/profiling/SendCounterPacket.hpp
    src/profiling/SendTimelinePacket.cpp
    src/profiling/SendTimelinePacket.hpp
    src/profiling/SocketProfilingConnection.cpp
    src/profiling/SocketProfilingConnection.hpp
    src/profiling/TimelinePacketWriterFactory.cpp
    src/profiling/TimelinePacketWriterFactory.hpp
    src/profiling/TimelineUtilityMethods.cpp
    src/profiling/TimelineUtilityMethods.hpp
    third-party/half/half.hpp
    )

# Files used for Streamline-based profiling backend
if(PROFILING_BACKEND_STREAMLINE)
    list(APPEND armnn_sources
        ${GATOR_ROOT}/annotate/streamline_annotate.h
        ${GATOR_ROOT}/annotate/streamline_annotate.c)
endif()

# the backends under src/backends extend the list of
# object libs armnn to include in the build
include(src/backends/backends.cmake)
foreach(lib ${armnnLibraries})
    message(STATUS "Adding object library dependency to armnn: ${lib}")
    list(APPEND armnn_sources $<TARGET_OBJECTS:${lib}>)
endforeach()

add_library_ex(armnn SHARED ${armnn_sources})

target_include_directories(armnn PRIVATE src/armnn)
target_include_directories(armnn PRIVATE src/armnnUtils)
target_include_directories(armnn PRIVATE src/backends)
target_include_directories(armnn PRIVATE src/profiling)

target_link_libraries(armnn armnnUtils)

target_link_libraries(armnn ${CMAKE_DL_LIBS})

install(TARGETS armnn
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(BUILD_CAFFE_PARSER)
    install(TARGETS armnnCaffeParser
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(BUILD_ONNX_PARSER)
    install(TARGETS armnnOnnxParser
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(BUILD_TF_PARSER)
    install(TARGETS armnnTfParser
            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

target_link_libraries(armnn ${Boost_LOG_LIBRARY} ${Boost_THREAD_LIBRARY}
                            ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})

if(ARMCOMPUTENEON OR ARMCOMPUTECL)
    target_link_libraries(armnn ${ARMCOMPUTE_LIBRARIES})
endif()
if(ARMCOMPUTECL AND OPENCL_LIBRARIES)
    target_link_libraries(armnn ${OPENCL_LIBRARIES})
endif()

if(PROFILING_BACKEND_STREAMLINE AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
    target_link_libraries(armnn ${CMAKE_THREAD_LIBS_INIT})
endif()

set_target_properties(armnn PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})

if(BUILD_UNIT_TESTS)
    set(unittest_sources)
    list(APPEND unittest_sources
        src/armnn/test/ConstTensorLayerVisitor.hpp
        src/armnn/test/ConstTensorLayerVisitor.cpp
        src/armnn/test/CreateWorkload.hpp
        src/armnn/test/CsvReaderTest.cpp
        src/armnn/test/EndToEndTest.cpp
        src/armnn/test/ExecutionFrameTest.cpp
        src/armnn/test/FloatingPointConverterTest.cpp
        src/armnn/test/FlowControl.cpp
        src/armnn/test/GraphTests.cpp
        src/armnn/test/GraphUtils.cpp
        src/armnn/test/GraphUtils.hpp
        src/armnn/test/InstrumentTests.cpp
        src/armnn/test/InferOutputTests.cpp
        src/armnn/test/InferOutputTests.hpp
        src/armnn/test/ModelAccuracyCheckerTest.cpp
        src/armnn/test/NetworkTests.cpp
        src/armnn/test/ObservableTest.cpp
        src/armnn/test/OptimizerTests.cpp
        src/armnn/test/optimizations/ConvertConstantsFloatToHalfTests.cpp
        src/armnn/test/optimizations/ConvertConstantsHalfToFloatTests.cpp
        src/armnn/test/optimizations/Fp32NetworkToFp16ConverterTests.cpp
        src/armnn/test/optimizations/InsertDebugLayerTests.cpp
        src/armnn/test/optimizations/MovePermuteUpTests.cpp
        src/armnn/test/optimizations/OptimizeConsecutiveReshapesTests.cpp
        src/armnn/test/optimizations/OptimizeInverseConversionsTests.cpp
        src/armnn/test/optimizations/OptimizeInversePermutesTests.cpp
        src/armnn/test/optimizations/PermuteAndBatchToSpaceAsDepthToSpaceTests.cpp
        src/armnn/test/optimizations/PermuteAsReshapeTests.cpp
        src/armnn/test/optimizations/SquashEqualSiblingsTests.cpp
        src/armnn/test/OptionalTest.cpp
        src/armnn/test/ProfilerTests.cpp
        src/armnn/test/ProfilingEventTest.cpp
        src/armnn/test/SubgraphViewTests.cpp
        src/armnn/test/TensorHandleStrategyTest.cpp
        src/armnn/test/TensorHelpers.hpp
        src/armnn/test/TensorTest.cpp
        src/armnn/test/TestInputOutputLayerVisitor.cpp
        src/armnn/test/TestInputOutputLayerVisitor.hpp
        src/armnn/test/TestLayerVisitor.cpp
        src/armnn/test/TestLayerVisitor.hpp
        src/armnn/test/TestNameOnlyLayerVisitor.cpp
        src/armnn/test/TestNameOnlyLayerVisitor.hpp
        src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp
        src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp
        src/armnn/test/TestUtils.cpp
        src/armnn/test/TestUtils.hpp
        src/armnn/test/UnitTests.cpp
        src/armnn/test/UnitTests.hpp
        src/armnn/test/UtilsTests.cpp
        src/armnnUtils/test/QuantizeHelperTest.cpp
        src/armnnUtils/test/PrototxtConversionsTest.cpp
        src/armnnUtils/test/ParserHelperTest.cpp
        src/armnnUtils/test/TensorUtilsTest.cpp
        src/profiling/test/BufferTests.cpp
        src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
        src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp
        src/profiling/test/ProfilingGuidTest.cpp
        src/profiling/test/ProfilingTests.cpp
        src/profiling/test/ProfilingTests.hpp
        src/profiling/test/SendCounterPacketTests.cpp
        src/profiling/test/SendCounterPacketTests.hpp
        src/profiling/test/SendTimelinePacketTests.cpp
        src/profiling/test/TimelinePacketTests.cpp
        src/profiling/test/TimelineUtilityMethodsTests.cpp
        )

    if(ARMNNREF)
        list(APPEND unittest_sources
            src/armnn/test/DebugCallbackTest.cpp
            src/armnn/test/QuantizerTest.cpp
            src/armnn/test/RuntimeTests.cpp
            src/armnn/test/RuntimeTests.hpp
            )
    endif()

    if(BUILD_TF_PARSER AND ARMNNREF)
        list(APPEND unittest_sources
            src/armnnTfParser/test/Activations.cpp
            src/armnnTfParser/test/Addition.cpp
            src/armnnTfParser/test/AddN.cpp
            src/armnnTfParser/test/Assert.cpp
            src/armnnTfParser/test/BiasAdd.cpp
            src/armnnTfParser/test/BroadcastForAdd.cpp
            src/armnnTfParser/test/Convolution2d.cpp
            src/armnnTfParser/test/Concat.cpp
            src/armnnTfParser/test/ConcatOfConcats.cpp
            src/armnnTfParser/test/DepthwiseConvolution2d.cpp
            src/armnnTfParser/test/Equal.cpp
            src/armnnTfParser/test/ExpandDims.cpp
            src/armnnTfParser/test/FusedBatchNorm.cpp
            src/armnnTfParser/test/Gather.cpp
            src/armnnTfParser/test/Greater.cpp
            src/armnnTfParser/test/Identity.cpp
            src/armnnTfParser/test/LocalResponseNormalization.cpp
            src/armnnTfParser/test/Maximum.cpp
            src/armnnTfParser/test/MaximumForLeakyRelu.cpp
            src/armnnTfParser/test/Mean.cpp
            src/armnnTfParser/test/Minimum.cpp
            src/armnnTfParser/test/Multiplication.cpp
            src/armnnTfParser/test/Pad.cpp
            src/armnnTfParser/test/MultiOutput.cpp
            src/armnnTfParser/test/PassThru.cpp
            src/armnnTfParser/test/Pooling.cpp
            src/armnnTfParser/test/RealDiv.cpp
            src/armnnTfParser/test/Reshape.cpp
            src/armnnTfParser/test/ResizeBilinear.cpp
            src/armnnTfParser/test/Rsqrt.cpp
            src/armnnTfParser/test/Shape.cpp
            src/armnnTfParser/test/Softmax.cpp
            src/armnnTfParser/test/TestDependencies.cpp
            src/armnnTfParser/test/FullyConnected.cpp
            src/armnnTfParser/test/Constant.cpp
            src/armnnTfParser/test/TestMultiInputsOutputs.cpp
            src/armnnTfParser/test/Split.cpp
            src/armnnTfParser/test/Squeeze.cpp
            src/armnnTfParser/test/Sub.cpp
            )

    endif()

    if(BUILD_TF_LITE_PARSER AND ARMNNREF)
        enable_language(ASM)
        list(APPEND unittest_sources
             src/armnnTfLiteParser/test/Activations.cpp
             src/armnnTfLiteParser/test/Addition.cpp
             src/armnnTfLiteParser/test/AvgPool2D.cpp
             src/armnnTfLiteParser/test/BatchToSpaceND.cpp
             src/armnnTfLiteParser/test/Concatenation.cpp
             src/armnnTfLiteParser/test/Constant.cpp
             src/armnnTfLiteParser/test/Conv2D.cpp
             src/armnnTfLiteParser/test/DepthwiseConvolution2D.cpp
             src/armnnTfLiteParser/test/DetectionPostProcess.cpp
             src/armnnTfLiteParser/test/FullyConnected.cpp
             src/armnnTfLiteParser/test/L2Normalization.cpp
             src/armnnTfLiteParser/test/Maximum.cpp
             src/armnnTfLiteParser/test/MaxPool2D.cpp
             src/armnnTfLiteParser/test/Mean.cpp
             src/armnnTfLiteParser/test/Minimum.cpp
             src/armnnTfLiteParser/test/Multiplication.cpp
             src/armnnTfLiteParser/test/Pack.cpp
             src/armnnTfLiteParser/test/Pad.cpp
             src/armnnTfLiteParser/test/Reshape.cpp
             src/armnnTfLiteParser/test/ResizeBilinear.cpp
             src/armnnTfLiteParser/test/Softmax.cpp
             src/armnnTfLiteParser/test/SpaceToBatchND.cpp
             src/armnnTfLiteParser/test/Slice.cpp
             src/armnnTfLiteParser/test/Split.cpp
             src/armnnTfLiteParser/test/Squeeze.cpp
             src/armnnTfLiteParser/test/StridedSlice.cpp
             src/armnnTfLiteParser/test/Sub.cpp
             src/armnnTfLiteParser/test/TransposeConv.cpp
             src/armnnTfLiteParser/test/Transpose.cpp
             src/armnnTfLiteParser/test/Unpack.cpp
             src/armnnTfLiteParser/test/Unsupported.cpp
             src/armnnTfLiteParser/test/LoadModel.cpp
             src/armnnTfLiteParser/test/GetBuffer.cpp
             src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp
             src/armnnTfLiteParser/test/InputOutputTensorNames.cpp
             src/armnnTfLiteParser/test/GetTensorIds.cpp
             src/armnnTfLiteParser/test/GetSubgraphInputsOutputs.cpp
             src/armnnTfLiteParser/test/GetInputsOutputs.cpp
             src/armnnTfLiteParser/test/Schema.s
             )
        set_source_files_properties(src/armnnTfLiteParser/test/Schema.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")

    endif()

    if(BUILD_CAFFE_PARSER AND ARMNNREF)
        list(APPEND unittest_sources
            src/armnnCaffeParser/test/TestAdd.cpp
            src/armnnCaffeParser/test/TestConcat.cpp
            src/armnnCaffeParser/test/TestConvolution.cpp
            src/armnnCaffeParser/test/TestDropout.cpp
            src/armnnCaffeParser/test/TestInputs.cpp
            src/armnnCaffeParser/test/TestMul.cpp
            src/armnnCaffeParser/test/TestPooling2d.cpp
            src/armnnCaffeParser/test/TestInPlace.cpp
            src/armnnCaffeParser/test/TestMultiInputsOutputs.cpp
            src/armnnCaffeParser/test/TestSplit.cpp
            )
    endif()

    if(BUILD_ONNX_PARSER AND ARMNNREF)
        list(APPEND unittest_sources
            src/armnnOnnxParser/test/Constructor.cpp
            src/armnnOnnxParser/test/CreateNetwork.cpp
            src/armnnOnnxParser/test/ProtoxtFixture.cpp
            src/armnnOnnxParser/test/Const.cpp
            src/armnnOnnxParser/test/Pooling.cpp
            src/armnnOnnxParser/test/Reshape.cpp
            src/armnnOnnxParser/test/Relu.cpp
            src/armnnOnnxParser/test/Conv2D.cpp
            src/armnnOnnxParser/test/Addition.cpp
            src/armnnOnnxParser/test/FullyConnected.cpp
            src/armnnOnnxParser/test/GetInputsOutputs.cpp
            src/armnnOnnxParser/test/BatchNorm.cpp
            src/armnnOnnxParser/test/DepthConv.cpp
            )
    endif()

    if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
        list(APPEND unittest_sources
             src/armnnQuantizer/test/QuantizationDataSetTests.cpp
             )
    endif()

    if(BUILD_ARMNN_SERIALIZER AND ARMNNREF)
        enable_language(ASM)
        list(APPEND unittest_sources
            src/armnnSerializer/test/ActivationSerializationTests.cpp
            src/armnnSerializer/test/SerializerTests.cpp
            src/armnnDeserializer/test/DeserializeAbs.cpp
            src/armnnDeserializer/test/DeserializeActivation.cpp
            src/armnnDeserializer/test/DeserializeAdd.cpp
            src/armnnDeserializer/test/DeserializeBatchToSpaceNd.cpp
            src/armnnDeserializer/test/DeserializeBatchNormalization.cpp
            src/armnnDeserializer/test/DeserializeComparison.cpp
            src/armnnDeserializer/test/DeserializeConstant.cpp
            src/armnnDeserializer/test/DeserializeConvolution2d.cpp
            src/armnnDeserializer/test/DeserializeDepthToSpace.cpp
            src/armnnDeserializer/test/DeserializeDivision.cpp
            src/armnnDeserializer/test/DeserializeFloor.cpp
            src/armnnDeserializer/test/DeserializeFullyConnected.cpp
            src/armnnDeserializer/test/DeserializeGather.cpp
            src/armnnDeserializer/test/DeserializeInstanceNormalization.cpp
            src/armnnDeserializer/test/DeserializeL2Normalization.cpp
            src/armnnDeserializer/test/DeserializeLogSoftmax.cpp
            src/armnnDeserializer/test/DeserializeMean.cpp
            src/armnnDeserializer/test/DeserializeMultiplication.cpp
            src/armnnDeserializer/test/DeserializeNormalization.cpp
            src/armnnDeserializer/test/DeserializePad.cpp
            src/armnnDeserializer/test/DeserializePermute.cpp
            src/armnnDeserializer/test/DeserializePooling2d.cpp
            src/armnnDeserializer/test/DeserializeReshape.cpp
            src/armnnDeserializer/test/DeserializeResizeBilinear.cpp
            src/armnnDeserializer/test/DeserializeRsqrt.cpp
            src/armnnDeserializer/test/DeserializeSlice.cpp
            src/armnnDeserializer/test/DeserializeSpaceToBatchNd.cpp
            src/armnnDeserializer/test/DeserializeStridedSlice.cpp
            src/armnnDeserializer/test/DeserializeSubtraction.cpp
            src/armnnDeserializer/test/ParserFlatbuffersSerializeFixture.hpp
            src/armnnDeserializer/test/SchemaSerialize.s
            )
        set_source_files_properties(src/armnnDeserializer/test/SchemaSerialize.s PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
    endif()

    if(BUILD_GATORD_MOCK)
        list(APPEND unittest_sources
            tests/profiling/gatordmock/tests/GatordMockTests.cpp
            tests/profiling/timelineDecoder/tests/TimelineTests.cpp
            )
    endif()

    if(COMPILER_IS_GNU_LIKE)
        set_source_files_properties(src/profiling/test/ProfilingGuidTest.cpp PROPERTIES COMPILE_FLAGS "-Wno-sign-conversion")
    endif()

    foreach(lib ${armnnUnitTestLibraries})
        message(STATUS "Adding object library dependency to UnitTests: ${lib}")
        list(APPEND unittest_sources $<TARGET_OBJECTS:${lib}>)
    endforeach()

    add_executable(UnitTests ${unittest_sources})
    target_include_directories(UnitTests PRIVATE src/armnn)
    target_include_directories(UnitTests PRIVATE src/armnnUtils)
    target_include_directories(UnitTests PRIVATE src/backends)
    target_include_directories(UnitTests PRIVATE src/profiling)

    if(VALGRIND_FOUND)
        if(HEAP_PROFILING OR LEAK_CHECKING)
            message(STATUS "Valgrind is disabled for heap profiling and leak checking builds.")
        else()
            # Valgrind works with gperftools version number <= 2.4
            target_compile_definitions(UnitTests PRIVATE "WITH_VALGRIND=1")
        endif()
    endif()

    target_link_libraries(UnitTests ${CMAKE_THREAD_LIBS_INIT})
    target_link_libraries(UnitTests ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})

    target_link_libraries(UnitTests armnn)
    target_link_libraries(UnitTests armnnUtils)

    if(BUILD_TF_PARSER)
        target_link_libraries(UnitTests armnnTfParser)
    endif()

    if(BUILD_GATORD_MOCK)
        target_link_libraries(UnitTests gatordMockService)
    endif()

    if(BUILD_TF_LITE_PARSER)
        target_include_directories(UnitTests SYSTEM PRIVATE "${TF_LITE_SCHEMA_INCLUDE_PATH}")
        target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
        target_link_libraries(UnitTests armnnTfLiteParser)
    endif()

    if(BUILD_CAFFE_PARSER)
        target_link_libraries(UnitTests armnnCaffeParser)
    endif()

    if(BUILD_ARMNN_SERIALIZER AND ARMNNREF)
        target_include_directories(UnitTests SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/armnnSerializer)
        target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
        target_link_libraries(UnitTests armnnSerializer)
    endif()

    if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
        target_include_directories(UnitTests SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src/armnnQuantizer)
        target_include_directories(UnitTests SYSTEM PRIVATE "${FLATBUFFERS_INCLUDE_PATH}")
        target_link_libraries(UnitTests armnnQuantizer armnnSerializer)
    endif()

    if(BUILD_ONNX_PARSER)
        target_link_libraries(UnitTests armnnOnnxParser)
    endif()

    addDllCopyCommands(UnitTests)
endif()

if (BUILD_ARMNN_SERIALIZER AND (BUILD_TF_PARSER OR BUILD_TF_LITE_PARSER OR BUILD_ONNX_PARSER OR BUILD_CAFFE_PARSER) AND ARMNNREF)
    set(ArmnnConverter_sources
        src/armnnConverter/ArmnnConverter.cpp)

    add_executable_ex(ArmnnConverter ${ArmnnConverter_sources})
    target_include_directories(ArmnnConverter PRIVATE src/armnn)
    target_include_directories(ArmnnConverter PRIVATE src/armnnUtils)

    if(BUILD_CAFFE_PARSER)
        target_link_libraries(ArmnnConverter armnnCaffeParser)
    endif()

    if(BUILD_ONNX_PARSER)
        target_link_libraries(ArmnnConverter armnnOnnxParser)
    endif()

    if(BUILD_TF_PARSER)
        target_link_libraries(ArmnnConverter armnnTfParser)
    endif()

    if(BUILD_TF_LITE_PARSER)
        target_link_libraries(ArmnnConverter armnnTfLiteParser)
    endif()

    target_link_libraries(ArmnnConverter armnnSerializer)

    target_link_libraries(ArmnnConverter armnn)
    target_link_libraries(ArmnnConverter ${CMAKE_THREAD_LIBS_INIT})
    target_link_libraries(ArmnnConverter
        ${Boost_SYSTEM_LIBRARY}
        ${Boost_FILESYSTEM_LIBRARY}
        ${Boost_PROGRAM_OPTIONS_LIBRARY})
    addDllCopyCommands(ArmnnConverter)
endif()

if(BUILD_GATORD_MOCK)
    set(gatord_mock_sources)
    list(APPEND gatord_mock_sources
        tests/profiling/gatordmock/CommandFileParser.hpp
        tests/profiling/gatordmock/CommandFileParser.cpp
        tests/profiling/gatordmock/CommandLineProcessor.hpp
        tests/profiling/gatordmock/CommandLineProcessor.cpp
        tests/profiling/gatordmock/GatordMockService.hpp
        tests/profiling/gatordmock/GatordMockService.cpp
        tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.cpp
        tests/profiling/gatordmock/PeriodicCounterCaptureCommandHandler.hpp
        tests/profiling/gatordmock/PeriodicCounterSelectionResponseHandler.cpp
        tests/profiling/gatordmock/PeriodicCounterSelectionResponseHandler.hpp
        tests/profiling/gatordmock/StreamMetadataCommandHandler.cpp
        tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp
        tests/profiling/timelineDecoder/ITimelineDecoder.h
        tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.cpp
        tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.hpp
        tests/profiling/timelineDecoder/TimelineDecoder.cpp
        tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp
        tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp
        tests/profiling/timelineDecoder/tests/TimelineTestFunctions.hpp
        )

    include_directories(${Boost_INCLUDE_DIRS} src/profiling)
    include_directories(${Boost_INCLUDE_DIRS} tests/profiling)
    include_directories(${Boost_INCLUDE_DIRS} tests/profiling/gatordmock)
    include_directories(${Boost_INCLUDE_DIRS} tests/profiling/timelineDecoder)

    add_library_ex(gatordMockService STATIC ${gatord_mock_sources})

    add_executable_ex(GartordMock tests/profiling/gatordmock/GatordMockMain.cpp)

    target_link_libraries(GartordMock
        armnn
        gatordMockService
        ${Boost_PROGRAM_OPTIONS_LIBRARY}
        ${Boost_SYSTEM_LIBRARY})

    if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
        target_link_libraries(GartordMock ${CMAKE_THREAD_LIBS_INIT})
    endif()

endif()